Closed kareem-abdul closed 1 month ago
Is this a BUG REPORT or FEATURE REQUEST?:
What happened:
/api/v1/public/tickets/create
tickets validation failed: status: Path 'status' is required.
How to reproduce it (as minimally and precisely as possible):
Allow Public Tickets
/newissue
Anything else we need to know?:
The same issue was raised here #611 which is now closed due to being stale. Looking into the source, the status field in the ticket schema is marked as required https://github.com/polonel/trudesk/blob/ad4c42c3b88c42d90e41b3615f1ee205925ad03e/src/models/ticket.js#L95-L100 and a default status is not being set in the public ticket creation API https://github.com/polonel/trudesk/blob/ad4c42c3b88c42d90e41b3615f1ee205925ad03e/src/controllers/api/v1/tickets.js#L635-L644 which causes the validation error that I'm facing right now
status
Environment:
Going through git blame, I found that status was a number with a default value of 0, and got converted to an object reference, removing the default value. ece5b345
Is this a BUG REPORT or FEATURE REQUEST?:
What happened:
/api/v1/public/tickets/create
API a 400 Bad Request is receivedtickets validation failed: status: Path 'status' is required.
How to reproduce it (as minimally and precisely as possible):
Allow Public Tickets
options/newissue
route.Anything else we need to know?:
The same issue was raised here #611 which is now closed due to being stale. Looking into the source, the
status
field in the ticket schema is marked as required https://github.com/polonel/trudesk/blob/ad4c42c3b88c42d90e41b3615f1ee205925ad03e/src/models/ticket.js#L95-L100 and a default status is not being set in the public ticket creation API https://github.com/polonel/trudesk/blob/ad4c42c3b88c42d90e41b3615f1ee205925ad03e/src/controllers/api/v1/tickets.js#L635-L644 which causes the validation error that I'm facing right nowEnvironment: