diff --git a/package.json b/package.json index 1671aba..23ea575 100644 --- a/package.json +++ b/package.json @@ -23,20 +23,20 @@ }, "devDependencies": { "@flaschengeist/types": "^1.0.0-alpha.5", - "@quasar/app": "^3.2.2", - "quasar": "^2.3.2", + "@quasar/app": "^3.2.3", + "quasar": "^2.3.3", "axios": "^0.24.0", "prettier": "^2.4.1", "typescript": "^4.4.4", - "pinia": "^2.0.3", + "pinia": "^2.0.4", "@typescript-eslint/eslint-plugin": "^5.4.0", "@typescript-eslint/parser": "^5.4.0", - "eslint": "^8.2.0", + "eslint": "^8.3.0", "eslint-config-prettier": "^8.3.0", - "eslint-plugin-vue": "^8.0.3" + "eslint-plugin-vue": "^8.1.1" }, "peerDependencies": { - "@flaschengeist/api": "^1.0.0-alpha.2", + "@flaschengeist/api": "^1.0.0-alpha.4", "@flaschengeist/users": "^1.0.0-alpha.1" }, "prettier": { diff --git a/src/api.d.ts b/src/api.d.ts index 4584a27..bf406f8 100644 --- a/src/api.d.ts +++ b/src/api.d.ts @@ -27,6 +27,7 @@ declare namespace FG { comment?: string; services: Array; required_services: number; + locked: boolean; } interface JobType { id: number; diff --git a/src/components/overview/slots/JobSlot.vue b/src/components/overview/slots/JobSlot.vue index 5c4a8f0..190f6a8 100644 --- a/src/components/overview/slots/JobSlot.vue +++ b/src/components/overview/slots/JobSlot.vue @@ -27,8 +27,29 @@ >
- - + + + + + + Einladen + + + Tauschen + + + + Austragen + + + +
@@ -36,9 +57,10 @@ \ No newline at end of file diff --git a/src/permissions.ts b/src/permissions.ts index c1bc584..00f29cf 100644 --- a/src/permissions.ts +++ b/src/permissions.ts @@ -13,4 +13,8 @@ export const PERMISSIONS = { ASSIGN: 'events_assign', // Can assign other users to jobs ASSIGN_OTHER: 'events_assign_other', + // Can see users assigned as backup + SEE_BACKUP: 'events_see_backup', + // Can lock jobs, no further services can be assigned or unassigned + LOCK_JOBS: 'events_lock_jobs', }; diff --git a/src/store.ts b/src/store.ts index 328a991..623e8f2 100644 --- a/src/store.ts +++ b/src/store.ts @@ -138,14 +138,8 @@ export const useEventStore = defineStore({ } }, - async updateJob(eventId: number, jobId: number, service: FG.Service | UserService) { - try { - const { data } = await api.put(`/events/${eventId}/jobs/${jobId}`, service); - fixJob(data); - return data; - } catch (error) { - throw error; - } + async assignToJob(jobId: number, service: FG.Service) { + return api.post(`/events/jobs/${jobId}/assign`, service); }, async addEvent(event: FG.Event) { @@ -161,5 +155,11 @@ export const useEventStore = defineStore({ return data; } }, + + async sendInvite(job: FG.Job, invitees: FG.User[], transfer = false) { + await Promise.resolve() + console.log(job, invitees, transfer) + return Promise.resolve() + } }, });