SnailyCAD / snaily-cadv4

💻 An open source Computer Aided Dispatch (CAD) for FiveM, this is a web based integration for communities who love police roleplaying and dispatching. Discord: https://discord.gg/eGnrPqEH7U
https://docs.snailycad.org/docs/getting-started
MIT License
147 stars 87 forks source link

Cannot edit a business, and cannot register business vehicles. #1756

Closed TheOnly3aq closed 1 year ago

TheOnly3aq commented 1 year ago

What version of Node.js are you using?

16.20.1

What operating system are you using?

Ubuntu

What version of SnailyCAD are you currently using?

1.66.0

Describe the Bug

Unable to edit anything in an existing business, the button just turns grey. Seems to only be the case under the Business tab. You ARE able to do these things when creating a business, just not when managing/editing the business. Screenshot is attached below.

Another thing, which may be related; when registe Screenshot 2023-08-15 at 09 31 17 ring a company vehicle, it'll say "Not Found (EmployeeNotFoundOrInvalidPermissions)". It does seem to register the vehicle, as you can't register something under the same plate again, it just doesn't show up in the registered vehicles tab.

Full error message when registering a company vehicle:

[Error] { "DEBUG": { "message": "Request failed with status code 404", "status": 404, "response": { "data": { "name": "NOT_FOUND", "message": "employeeNotFoundOrInvalidPermissions", "status": 404, "errors": [] }, "status": 404, "statusText": "Not Found", "headers": { "content-length": "94", "content-type": "application/json; charset=utf-8" }, "config": { "transitional": { "silentJSONParsing": true, "forcedJSONParsing": true, "clarifyTimeoutError": false }, "adapter": [ "xhr", "http" ], "transformRequest": [ null ], "transformResponse": [ null ], "timeout": 0, "xsrfCookieName": "XSRF-TOKEN", "xsrfHeaderName": "X-XSRF-TOKEN", "maxContentLength": -1, "maxBodyLength": -1, "env": {}, "headers": { "Accept": "application/json, text/plain, /", "Content-Type": "application/json", "Session": "", "is-from-dispatch": "false" }, "url": "https://api.alaskaroleplay.com/v1/vehicles", "method": "post", "data": "{\"model\":\"test\",\"modelName\":\"test\",\"trimLevels\":[],\"color\":\"test\",\"insuranceStatus\":\"clgsb1nob01p4ydqd4izc0q22\",\"inspectionStatus\":\"PASSED\",\"taxStatus\":\"TAXED\",\"registrationStatus\":\"clgsb1nob01p4ydqd4izc0q22\",\"citizenId\":\"cllaw1pqu000lydojamkrvpco\",\"name\":\"Mallikarjun Mavnoor\",\"plate\":\"TESTTEDS\",\"vinNumber\":\"\",\"reportedStolen\":false,\"businessId\":\"cllbaie3y00arydojp2wn5hmc\",\"employeeId\":\"cllbaie4200atydojmr62x309\"}", "withCredentials": true }, "request": { "sentry_xhr_v2": { "method": "POST", "url": "https://api.alaskaroleplay.com/v1/vehicles", "request_headers": { "accept": "application/json, text/plain, /", "content-type": "application/json", "session": "", "is-from-dispatch": "false" }, "body": "{\"model\":\"test\",\"modelName\":\"test\",\"trimLevels\":[],\"color\":\"test\",\"insuranceStatus\":\"clgsb1nob01p4ydqd4izc0q22\",\"inspectionStatus\":\"PASSED\",\"taxStatus\":\"TAXED\",\"registrationStatus\":\"clgsb1nob01p4ydqd4izc0q22\",\"citizenId\":\"cllaw1pqu000lydojamkrvpco\",\"name\":\"Mallikarjun Mavnoor\",\"plate\":\"TESTTEDS\",\"vinNumber\":\"\",\"reportedStolen\":false,\"businessId\":\"cllbaie3y00arydojp2wn5hmc\",\"employeeId\":\"cllbaie4200atydojmr62x309\"}", "status_code": 404 } } }, "method": "post", "data": "{\"model\":\"test\",\"modelName\":\"test\",\"trimLevels\":[],\"color\":\"test\",\"insuranceStatus\":\"clgsb1nob01p4ydqd4izc0q22\",\"inspectionStatus\":\"PASSED\",\"taxStatus\":\"TAXED\",\"registrationStatus\":\"clgsb1nob01p4ydqd4izc0q22\",\"citizenId\":\"cllaw1pqu000lydojamkrvpco\",\"name\":\"Mallikarjun Mavnoor\",\"plate\":\"TESTTEDS\",\"vinNumber\":\"\",\"reportedStolen\":false,\"businessId\":\"cllbaie3y00arydojp2wn5hmc\",\"employeeId\":\"cllbaie4200atydojmr62x309\"}", "url": "https://api.alaskaroleplay.com/v1/vehicles" } } (anonymous function) (_app-35aa06d160f3a500.js:4:19731) (anonymous function) (4007-7be4368e84e4fcdf.js:1:22524)

Expected Behavior

I would expect vehicles to just register, and the save button not being greyed out.

To Reproduce

Create a new business, then add an address of the business. After that save the business, and then try to edit anything under the business tab; nothing works, save button will just grey out.

For business vehicles, try to register a vehicle and you'll get the error message shown in the description field.

casperiv0 commented 1 year ago

What is the current role you have in this business?

TheOnly3aq commented 1 year ago

That would be Owner, since I created it. I also had another character join, and gave them all permissions; yet it still did not work.

casperiv0 commented 1 year ago

Thanks for reporting! This issue is now fixed!