Skip to content

Commit

Permalink
Adjust db vehicle controller
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianGrabitzky committed Sep 13, 2023
1 parent ec79715 commit 1aa2dc3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Server/src/services/db/vehicle.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default class VehicleController {
* @returns
*/
public async updateType(uid: number, args: Prisma.VehicleTypeUpdateInput): Promise<VehicleType> {
if (args.inactive == undefined || args.inactive == false) {
if (args.inactive == false) {
// Operation tried to ressurrect type
throw new Prisma.PrismaClientKnownRequestError("Tried to ressurrect type.", {
code: "P2002",
Expand Down Expand Up @@ -228,7 +228,7 @@ export default class VehicleController {
*/
public async update(uid: number, args: Prisma.VehicleUncheckedUpdateInput): Promise<Vehicle | null> {
// VehicleUncheckCreateInput is used because of required relations
if (args.inactive == undefined || args.inactive == false) {
if (args.inactive == false) {
// Operation tried to resurrect vehicle
throw new Prisma.PrismaClientKnownRequestError("Vehicle already exists in active state.", {
code: "P2002",
Expand Down

0 comments on commit 1aa2dc3

Please sign in to comment.