Skip to content

Commit

Permalink
seperate fetchEntity into different types
Browse files Browse the repository at this point in the history
  • Loading branch information
mafewtm committed Jan 5, 2024
1 parent 2a49a98 commit 85bc85e
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion server/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,41 @@ local function fetchEntity(query)
return vehicleData
end

exports('FetchVehicleEntity', fetchEntity)
---Fetches DB Vehicle Entity by CiizenId
---@param citizenId string
---@return vehicleData[]
local function fetchEntityByCitizenId(citizenId)
fetchEntity({
valueType = 'citizenid',
value = citizenId
})
end

exports('FetcEntityByCitizenId', fetchEntityByCitizenId)

---Fetches DB Vehicle Entity by License
---@param license string
---@return vehicleData[]
local function fetchEntityByLicense(license)
fetchEntity({
valueType = 'license',
value = license
})
end

exports('FetchEntityByLicense', fetchEntityByLicense)

---Fetches DB Vehicle Entity by Plate
---@param plate string
---@return vehicleData[]
local function fetchEntityByPlate(plate)
fetchEntity({
valueType = 'plate',
value = plate
})
end

exports('FetchEntityByPlate', fetchEntityByPlate)

---@class UpdateEntityVehicleQuery
---@field valueType string
Expand Down

0 comments on commit 85bc85e

Please sign in to comment.