Skip to content

Commit

Permalink
🐛 fix: only send required data for mark-stolen (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
casperiv0 authored Jan 5, 2022
1 parent e3e454d commit 0b97cc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/api/src/controllers/dispatch/BoloController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class BoloController {
@Use(ActiveOfficer)
@Post("/mark-stolen/:id")
async reportVehicleStolen(@BodyParams() body: JsonRequestBody) {
const { id, color, model, plate } = body.toJSON();
const { id, color, modelId, plate } = body.toJSON();

const vehicle = await prisma.registeredVehicle.findUnique({
where: { id },
Expand All @@ -149,7 +149,7 @@ export class BoloController {
description: "stolen",
type: "VEHICLE",
color: color || null,
model: model?.value || null,
model: modelId || null,
plate: plate || null,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ export function VehicleSearchModal() {

const { json } = await execute(`/bolos/mark-stolen/${results.id}`, {
method: "POST",
data: results,
data: {
id: results.id,
color: results.color,
modelId: results.modelId,
plate: results.plate,
},
});

if (json) {
Expand Down

0 comments on commit 0b97cc1

Please sign in to comment.