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
140 stars 84 forks source link

License Categories broken for Hunting & Fishing Licenses #1816

Closed Alfa1561 closed 11 months ago

Alfa1561 commented 11 months ago

What version of Node.js are you using?

18.17.1

What operating system are you using?

Linux

What version of SnailyCAD are you currently using?

1.73.1

Describe the Bug

image_2023-10-02_194524974 image_2023-10-02_194540962

When trying to add a license category for hunting or fishing on the civ page, it shows the water license category options.

When trying to add new license category types on the admin panel for hunting or fishing licenses, they fail to add correctly. It simply does not add them to the list.

Expected Behavior

On the civ page, hunting & fishing license categories should display options from their own types, not the water license category.

On the admin panel, it should accept new license categories for hunting and fishing licenses.

To Reproduce

No response

Legacy-TacticalGamingInteractive commented 11 months ago

On this, I am not able to add any new categories either. When I click Add Category it does nothing. If I look at the console I see these other errors.

image

instrument.js:122 {
  "DEBUG": {
    "message": "Request failed with status code 400",
    "status": 400,
    "response": {
      "data": {
        "name": "BAD_REQUEST",
        "message": "badRequest",
        "status": 400,
        "errors": [
          {
            "0": "Invalid"
          }
        ]
      },
      "status": 400,
      "statusText": "Bad Request",
      "headers": {
        "content-length": "85",
        "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.enemyofthestaterp.com/v1/admin/values/driverslicense_category",
        "method": "post",
        "data": "{\"isDisabled\":false,\"value\":\"Seasonal Hunting License\",\"description\":\"\",\"qualificationType\":\"QUALIFICATION\",\"shouldDo\":\"\",\"color\":\"\",\"textColor\":\"\",\"type\":\"HUNTING\",\"whatPages\":[],\"pairedUnitTemplate\":\"\",\"departmentId\":\"\",\"isConfidential\":false,\"whitelisted\":false,\"defaultOfficerRankId\":null,\"isDefaultDepartment\":false,\"callsign\":\"\",\"customTemplate\":\"\",\"as\":\"\",\"trimLevels\":[],\"licenseType\":null,\"officerRankImageId\":\"\",\"postal\":\"\",\"county\":\"\",\"showPicker\":false,\"image\":\"\",\"extraFields\":null,\"departmentLinks\":[]}",
        "withCredentials": true
      },
      "request": {
        "__sentry_xhr_v2__": {
          "method": "POST",
          "url": "https://api.enemyofthestaterp.com/v1/admin/values/driverslicense_category",
          "request_headers": {
            "accept": "application/json, text/plain, */*",
            "content-type": "application/json",
            "session": "",
            "is-from-dispatch": "false"
          },
          "body": "{\"isDisabled\":false,\"value\":\"Seasonal Hunting License\",\"description\":\"\",\"qualificationType\":\"QUALIFICATION\",\"shouldDo\":\"\",\"color\":\"\",\"textColor\":\"\",\"type\":\"HUNTING\",\"whatPages\":[],\"pairedUnitTemplate\":\"\",\"departmentId\":\"\",\"isConfidential\":false,\"whitelisted\":false,\"defaultOfficerRankId\":null,\"isDefaultDepartment\":false,\"callsign\":\"\",\"customTemplate\":\"\",\"as\":\"\",\"trimLevels\":[],\"licenseType\":null,\"officerRankImageId\":\"\",\"postal\":\"\",\"county\":\"\",\"showPicker\":false,\"image\":\"\",\"extraFields\":null,\"departmentLinks\":[]}",
          "status_code": 400
        }
      }
    },
    "method": "post",
    "data": "{\"isDisabled\":false,\"value\":\"Seasonal Hunting License\",\"description\":\"\",\"qualificationType\":\"QUALIFICATION\",\"shouldDo\":\"\",\"color\":\"\",\"textColor\":\"\",\"type\":\"HUNTING\",\"whatPages\":[],\"pairedUnitTemplate\":\"\",\"departmentId\":\"\",\"isConfidential\":false,\"whitelisted\":false,\"defaultOfficerRankId\":null,\"isDefaultDepartment\":false,\"callsign\":\"\",\"customTemplate\":\"\",\"as\":\"\",\"trimLevels\":[],\"licenseType\":null,\"officerRankImageId\":\"\",\"postal\":\"\",\"county\":\"\",\"showPicker\":false,\"image\":\"\",\"extraFields\":null,\"departmentLinks\":[]}",
    "url": "https://api.enemyofthestaterp.com/v1/admin/values/driverslicense_category"
  }
}
(anonymous) @ instrument.js:122
api
bartusek27 commented 11 months ago

Same for me +1

casperiv0 commented 11 months ago

Fixed now!