mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-23 13:23:04 +00:00
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:
@@ -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>;
|
||||
|
||||
Reference in New Issue
Block a user