polonel / trudesk

:coffee: :seedling: Trudesk is an open-source help desk/ticketing solution.
http://trudesk.io
Other
1.29k stars 430 forks source link

[BUG] Error on create new Public Tickets #682

Closed kareem-abdul closed 1 month ago

kareem-abdul commented 2 months ago

Is this a BUG REPORT or FEATURE REQUEST?:

What happened:

How to reproduce it (as minimally and precisely as possible):

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 image

Environment:

kareem-abdul commented 2 months ago

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