Fix DELETE sending empty JSON body, add repair_note to allowed file entity types
API client no longer sets Content-Type: application/json on requests without a body (fixes DELETE 400 errors). Added repair_note to the allowed entityTypes whitelist for file uploads so photos can be attached to repair notes.
This commit is contained in:
@@ -42,7 +42,7 @@ export const fileRoutes: FastifyPluginAsync = async (app) => {
|
||||
}
|
||||
|
||||
// Validate entityType is a known type
|
||||
const allowedEntityTypes = ['user', 'member', 'member_identifier', 'product', 'rental_agreement', 'repair_ticket']
|
||||
const allowedEntityTypes = ['user', 'member', 'member_identifier', 'product', 'rental_agreement', 'repair_ticket', 'repair_note']
|
||||
if (!allowedEntityTypes.includes(entityType)) {
|
||||
throw new ValidationError(`Invalid entityType: ${entityType}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user