From 10cc5cf42aa6deecd2f899ef13adec073916b1da Mon Sep 17 00:00:00 2001 From: Gregor Vostrak Date: Mon, 5 Aug 2024 15:02:51 +0200 Subject: [PATCH] seperate project types, make tag dropdown location configurable, update api client --- openapi.json.client.ts | 40 +++-------------- .../Common/Member/MemberBillableSelect.vue | 2 +- .../Common/Project/ProjectBillableSelect.vue | 2 +- .../Project/ProjectEditBillableSection.vue | 2 +- .../js/Components/Common/Tag/TagDropdown.vue | 43 +++++++++++-------- .../TimeEntry/TimeEntryRowTagDropdown.vue | 1 + .../TimeTracker/TimeTrackerControls.vue | 2 +- resources/js/types/projects.d.ts | 1 + resources/js/utils/useProjects.ts | 2 - 9 files changed, 37 insertions(+), 58 deletions(-) create mode 100644 resources/js/types/projects.d.ts diff --git a/openapi.json.client.ts b/openapi.json.client.ts index a4829c89..2a6442ab 100644 --- a/openapi.json.client.ts +++ b/openapi.json.client.ts @@ -218,7 +218,7 @@ const UserResource = z week_start: Weekday, }) .passthrough(); -const PersonalMemberResource = z +const PersonalMembershipResource = z .object({ id: z.string(), organization: z @@ -227,6 +227,7 @@ const PersonalMemberResource = z role: z.string(), }) .passthrough(); +const PersonalMembershipCollection = z.array(PersonalMembershipResource); export const schemas = { ClientResource, @@ -262,7 +263,8 @@ export const schemas = { TimeEntryUpdateRequest, Weekday, UserResource, - PersonalMemberResource, + PersonalMembershipResource, + PersonalMembershipCollection, }; const endpoints = makeApi([ @@ -2504,42 +2506,12 @@ If the group parameters are all set to `null` or are all missing, the }, { method: 'get', - path: '/v1/users/me/members', + path: '/v1/users/me/memberships', alias: 'getMyMemberships', description: `This endpoint is independent of organization.`, requestFormat: 'json', response: z - .object({ - data: z.array(PersonalMemberResource), - links: z - .object({ - first: z.union([z.string(), z.null()]), - last: z.union([z.string(), z.null()]), - prev: z.union([z.string(), z.null()]), - next: z.union([z.string(), z.null()]), - }) - .passthrough(), - meta: z - .object({ - current_page: z.number().int(), - from: z.union([z.number(), z.null()]), - last_page: z.number().int(), - links: z.array( - z - .object({ - url: z.union([z.string(), z.null()]), - label: z.string(), - active: z.boolean(), - }) - .passthrough() - ), - path: z.union([z.string(), z.null()]), - per_page: z.number().int(), - to: z.union([z.number(), z.null()]), - total: z.number().int(), - }) - .passthrough(), - }) + .object({ data: PersonalMembershipCollection }) .passthrough(), errors: [ { diff --git a/resources/js/Components/Common/Member/MemberBillableSelect.vue b/resources/js/Components/Common/Member/MemberBillableSelect.vue index 300eef73..9d37f8a5 100644 --- a/resources/js/Components/Common/Member/MemberBillableSelect.vue +++ b/resources/js/Components/Common/Member/MemberBillableSelect.vue @@ -1,8 +1,8 @@