mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
fix types: patch allows partial type
This commit is contained in:
@@ -3,7 +3,7 @@ import { BOOKING_STATUS } from '../db/enums'
|
||||
import { dateFormatBackend } from './date';
|
||||
import fetch from './fetch'
|
||||
|
||||
function getBody(formData: BookFormData) {
|
||||
function getBody(formData: Partial<BookFormData>) {
|
||||
const body: any = {
|
||||
...formData,
|
||||
};
|
||||
@@ -44,7 +44,7 @@ export async function cancelBooking(uuid: string) {
|
||||
})
|
||||
}
|
||||
|
||||
export async function patchBooking(uuid: string, bookingData: BookFormData) {
|
||||
export async function patchBooking(uuid: string, bookingData: Partial<BookFormData>) {
|
||||
return fetch(`/api/bookings/${uuid}`, {
|
||||
method: 'PATCH',
|
||||
body: getBody(bookingData),
|
||||
|
||||
Reference in New Issue
Block a user