feat : finalisation de l'étape 1 "Réception" (formulaire)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import type { ReceptionData } from '~/services/dto/reception-data'
|
||||
import type { ReceptionData, ReceptionPayload } from '~/services/dto/reception-data'
|
||||
import { createReception, getReception, updateReception } from '~/services/reception'
|
||||
|
||||
const isReceptionData = (value: unknown): value is ReceptionData => {
|
||||
@@ -31,7 +31,7 @@ export const useReceptionStore = defineStore('reception', {
|
||||
this.current = result
|
||||
return result
|
||||
},
|
||||
async createReception(payload: Partial<ReceptionData> = {}) {
|
||||
async createReception(payload: ReceptionPayload = {}) {
|
||||
this.isLoading = true
|
||||
const result = await createReception(payload).finally(() => {
|
||||
this.isLoading = false
|
||||
@@ -43,7 +43,7 @@ export const useReceptionStore = defineStore('reception', {
|
||||
this.current = result
|
||||
return result
|
||||
},
|
||||
async updateReception(id: number, payload: Partial<ReceptionData>) {
|
||||
async updateReception(id: number, payload: ReceptionPayload) {
|
||||
this.isLoading = true
|
||||
const result = await updateReception(id, payload).finally(() => {
|
||||
this.isLoading = false
|
||||
|
||||
Reference in New Issue
Block a user