Skip to content

Commit

Permalink
chore: bump sudosos-client
Browse files Browse the repository at this point in the history
  • Loading branch information
JustSamuel committed Sep 6, 2024
1 parent 4601d36 commit 9c04c24
Show file tree
Hide file tree
Showing 9 changed files with 280 additions and 268 deletions.
2 changes: 1 addition & 1 deletion apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"dependencies": {
"@stripe/stripe-js": "^4.4.0",
"@sudosos/sudosos-client": "github:GEWIS/sudosos-client#ba8d67ec53b2232d19aec9408d2f53924dcdf6af",
"@sudosos/sudosos-client": "github:GEWIS/sudosos-client#3bf2ffe021b10165d0ba54285bb9bd1c4401d5bd",
"@sudosos/sudosos-frontend-common": "workspace:^",
"@types/dinero.js": "^1.9.4",
"@vee-validate/rules": "^4.12.8",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const updateFieldValues = (p: UserResponse) => {
if (!p) return;
const values = {
...p,
userType: userTypes.value.find(ut => ut.name === p.type)?.value || undefined,
userType: p.type,
isActive: p.active,
};
form.context.resetForm({ values });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,13 @@ const props = defineProps({
setSubmit(props.form, props.form.context.handleSubmit(async (values) => {
const createUserRequest: CreateUserRequest = {
...values,
canGoIntoDebt: values.canGoIntoDebt,
ofAge: values.ofAge,
firstName: values.firstName,
lastName: values.lastName || '',
email: values.email || '',
nickname: values.nickname || '',
type: values.userType,
ofAge: values.ofAge,
canGoIntoDebt: values.canGoIntoDebt,
type: values.userType
};
await apiService.user.createUser(createUserRequest).then(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,15 @@ onMounted(() => {
description: t('transactions.Excl'),
amount: 1,
vatPercentage: 0,
priceInclVat: exclVat.value
priceInclVat: exclVat.value,
custom: false,
});
for (const key in vat.value) {
totalRows.push({
description: t('transactions.VAT', { vat: key }),
amount: 1,
custom: false,
vatPercentage: Number(key),
priceInclVat: vat.value[key]
});
Expand All @@ -126,7 +128,8 @@ onMounted(() => {
description: t('transactions.Incl'),
amount: 1,
vatPercentage: 0,
priceInclVat: props.invoice.transfer.amountInclVat
priceInclVat: props.invoice.transfer.amountInclVat,
custom: false,
});
}
Expand Down
20 changes: 10 additions & 10 deletions apps/dashboard/src/utils/validation-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const createUserSchema =
lastName: yup.string().required(),
email: yup.string().email(),
nickname: yup.string(),
userType: yup.number().required().default(4),
userType: yup.string().required().default("LOCAL_USER"),
ofAge: yup.boolean().required().default(false),
canGoIntoDebt: yup.boolean().required().default(false),
});
Expand Down Expand Up @@ -56,7 +56,7 @@ export const updateUserDetailsObject = yup.object({
lastName: yup.string(),
email: yup.string().email(),
nickname: yup.string().nullable(),
userType: yup.number().required(),
userType: yup.string().required(),
isActive: yup.boolean().required().default(true),
ofAge: yup.boolean().required().default(false),
canGoIntoDebt: yup.boolean().required().default(false),
Expand All @@ -71,14 +71,14 @@ export const editPinSchema =
pinConfirm: yup.string().required().oneOf([yup.ref('pin')], t('validation.pin.match')),
});

export const userTypes : Ref<Array<{name: string, value: number}>> = ref([
{ name: 'MEMBER', value: 1 },
{ name: 'ORGAN', value: 2 },
{ name: 'VOUCHER', value: 3 },
{ name: 'LOCAL_USER', value: 4 },
{ name: 'LOCAL_ADMIN', value: 5 },
{ name: 'INVOICE', value: 6 },
{ name: 'AUTOMATIC_INVOICE', value: 7 },
export const userTypes : Ref<Array<{name: string}>> = ref([
{ name: 'MEMBER' },
{ name: 'ORGAN' },
{ name: 'VOUCHER' },
{ name: 'LOCAL_USER' },
{ name: 'LOCAL_ADMIN' },
{ name: 'INVOICE' },
{ name: 'AUTOMATIC_INVOICE' },
]);

export const createPayoutSchema =
Expand Down
2 changes: 1 addition & 1 deletion apps/point-of-sale/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
},
"dependencies": {
"@popperjs/core": "^2.11.8",
"@sudosos/sudosos-client": "github:GEWIS/sudosos-client#ba8d67ec53b2232d19aec9408d2f53924dcdf6af",
"@sudosos/sudosos-client": "github:GEWIS/sudosos-client#3bf2ffe021b10165d0ba54285bb9bd1c4401d5bd",
"@sudosos/sudosos-frontend-common": "workspace:^",
"bootstrap": "^5.3.0",
"dinero": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion lib/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"homepage": "https://gitlab.com/sudosos/sudosos-frontend-common#readme",
"dependencies": {
"@babel/types": "^7.23.6",
"@sudosos/sudosos-client": "github:GEWIS/sudosos-client#ba8d67ec53b2232d19aec9408d2f53924dcdf6af",
"@sudosos/sudosos-client": "github:GEWIS/sudosos-client#3bf2ffe021b10165d0ba54285bb9bd1c4401d5bd",
"axios": "^1.6.8",
"jwt-decode": "^4.0.0",
"pinia": "^2.1.7",
Expand Down
2 changes: 1 addition & 1 deletion lib/common/src/stores/user.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const useUserStore = defineStore('user', {
async fetchGewisUser(id: number, service: ApiService): Promise<GewisUserResponse> {
return service.user.getIndividualUser(id).then((res) => {
this.current.user = res.data;
return res.data;
return res.data as GewisUserResponse;
});
},
setCurrentUser(user: UserResponse) {
Expand Down
Loading

0 comments on commit 9c04c24

Please sign in to comment.