Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
12 changes: 10 additions & 2 deletions server/backend/warrants.lua
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,17 @@ ps.registerCallback(resourceName .. ':server:issueWarrant', function(source, dat
return { success = false, error = 'Missing required fields' }
end

local existing = MySQL.single.await('SELECT reportid FROM mdt_reports_warrants WHERE reportid = ? AND citizenid = ?', { reportId, citizenid })
if existing and existing.reportid then
local activeWarrant = MySQL.single.await('SELECT reportid FROM mdt_reports_warrants WHERE reportid = ? AND citizenid = ? AND expirydate >= NOW()', { reportId, citizenid })
if activeWarrant then
return { success = false, error = 'An active warrant already exists for this subject on this report' }
end

local expiredWarrant = MySQL.single.await('SELECT reportid FROM mdt_reports_warrants WHERE reportid = ? AND citizenid = ?', { reportId, citizenid })
if expiredWarrant then
-- Expired row exists, reactivate it with new expiry
MySQL.update.await([[
UPDATE mdt_reports_warrants SET expirydate = ? WHERE reportid = ? AND citizenid = ?
]], { expiryDate, reportId, citizenid })
else
MySQL.insert.await([[
INSERT INTO mdt_reports_warrants (reportid, citizenid, felonies, misdemeanors, infractions, expirydate)
Expand Down
16 changes: 0 additions & 16 deletions web/node_modules/.bin/0ecdsa-generate-keypair

This file was deleted.

17 changes: 0 additions & 17 deletions web/node_modules/.bin/0ecdsa-generate-keypair.cmd

This file was deleted.

28 changes: 0 additions & 28 deletions web/node_modules/.bin/0ecdsa-generate-keypair.ps1

This file was deleted.

16 changes: 0 additions & 16 deletions web/node_modules/.bin/0gentesthtml

This file was deleted.

17 changes: 0 additions & 17 deletions web/node_modules/.bin/0gentesthtml.cmd

This file was deleted.

28 changes: 0 additions & 28 deletions web/node_modules/.bin/0gentesthtml.ps1

This file was deleted.

16 changes: 0 additions & 16 deletions web/node_modules/.bin/0serve

This file was deleted.

17 changes: 0 additions & 17 deletions web/node_modules/.bin/0serve.cmd

This file was deleted.

28 changes: 0 additions & 28 deletions web/node_modules/.bin/0serve.ps1

This file was deleted.

21 changes: 0 additions & 21 deletions web/node_modules/.bin/acorn

This file was deleted.

12 changes: 0 additions & 12 deletions web/node_modules/.bin/acorn.CMD

This file was deleted.

41 changes: 0 additions & 41 deletions web/node_modules/.bin/acorn.ps1

This file was deleted.

16 changes: 0 additions & 16 deletions web/node_modules/.bin/esbuild

This file was deleted.

17 changes: 0 additions & 17 deletions web/node_modules/.bin/esbuild.cmd

This file was deleted.

28 changes: 0 additions & 28 deletions web/node_modules/.bin/esbuild.ps1

This file was deleted.

21 changes: 0 additions & 21 deletions web/node_modules/.bin/jiti

This file was deleted.

12 changes: 0 additions & 12 deletions web/node_modules/.bin/jiti.CMD

This file was deleted.

Loading