fix(server): hold DELETE bodies to the same contract as every other write

The body-contract boot gate only looked at POST/PUT/PATCH, so a DELETE that
reads a body slipped past it. Two do; one was already typed, the other read
photo_id straight off an untyped Record. Give it a contract from shared like
everything else, then add DELETE to the gate so the next one cannot repeat it.
This commit is contained in:
Maurice
2026-08-23 09:34:53 +02:00
committed by Maurice
parent 3f8a7a1ea9
commit b163c1e05d
5 changed files with 30 additions and 4 deletions
+6
View File
@@ -92,6 +92,11 @@ export const setTripPhotoSharingSchema = z.looseObject({
shared: z.unknown().optional(),
});
/** The photo to unlink from the trip. Same shape the sharing toggle takes. */
export const removeTripPhotoSchema = z.looseObject({
photo_id: looseNumber,
});
export const createAlbumLinkSchema = z.looseObject({
provider: z.unknown().optional(),
album_id: z.unknown().optional(),
@@ -108,4 +113,5 @@ export type SynologySearchInput = z.infer<typeof synologySearchSchema>;
export type PhotoSelectionInput = z.infer<typeof photoSelectionSchema>;
export type AddTripPhotosInput = z.infer<typeof addTripPhotosSchema>;
export type SetTripPhotoSharingInput = z.infer<typeof setTripPhotoSharingSchema>;
export type RemoveTripPhotoInput = z.infer<typeof removeTripPhotoSchema>;
export type CreateAlbumLinkInput = z.infer<typeof createAlbumLinkSchema>;