mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-21 03:26:07 +00:00
fix(packing): anyone on the trip can be put down as the bringer of a shared item, and taken off again (#3098)
A common item only let you pledge yourself. Nobody else could be named, and a bringer could never be removed, so an item that went personal and back kept its owner's avatar for good. The item menu now lists every member to tick on or off, a click on the avatar opens it there, and the add route takes an optional user_id limited to the trip's members. Taking the owner off clears the owner. The remove route now checks visibility for the caller, not for the user named in the path.
This commit is contained in:
@@ -121,6 +121,13 @@ export const packingSetSharingRequestSchema = z.object({
|
||||
});
|
||||
export type PackingSetSharingRequest = z.infer<typeof packingSetSharingRequestSchema>;
|
||||
|
||||
// Who brings a Common item (#3098): without a body the caller pledges themselves,
|
||||
// with user_id anyone on the trip can be put down as a bringer.
|
||||
export const packingAddContributorRequestSchema = z.object({
|
||||
user_id: z.number().int().positive().optional(),
|
||||
});
|
||||
export type PackingAddContributorRequest = z.infer<typeof packingAddContributorRequestSchema>;
|
||||
|
||||
export const packingUpdateItemRequestSchema = z.object({
|
||||
name: z.string().optional(),
|
||||
// The legacy route accepted both boolean and 0/1 for checked — both stay valid.
|
||||
|
||||
Reference in New Issue
Block a user