Skip to content

Commit

Permalink
chore: running eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Danilo Romano committed May 22, 2024
1 parent c22adce commit 0070159
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
5 changes: 4 additions & 1 deletion src/shelter-supply/shelter-supply.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ export class ShelterSupplyController {
data,
);
} catch (err: any) {
this.logger.error(`Failed to update many shelter supplies: ${err}`,err.stack);
this.logger.error(
`Failed to update many shelter supplies: ${err}`,
err.stack,
);
throw new HttpException(err?.code ?? err?.name ?? `${err}`, 400);
}
}
Expand Down
25 changes: 12 additions & 13 deletions src/shelter-supply/shelter-supply.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
UpdateManyShelterSupplySchema,
UpdateShelterSupplySchema,
} from './types';
import { Prisma } from '@prisma/client';

@Injectable()
export class ShelterSupplyService {
Expand Down Expand Up @@ -108,19 +107,19 @@ export class ShelterSupplyService {
0,
);

await this.prismaService.$transaction(async tx => {
await this.prismaService.$transaction(async (tx) => {
await tx.shelter.update({
where: {
id: shelterId,
},
data: {
prioritySum: {
decrement: prioritySum,
},
updatedAt: new Date().toISOString(),
where: {
id: shelterId,
},
data: {
prioritySum: {
decrement: prioritySum,
},
}),
await tx.shelterSupply.updateAndAuditMany({
updatedAt: new Date().toISOString(),
},
}),
await tx.shelterSupply.updateAndAuditMany({
...audit,
where: {
shelterId,
Expand All @@ -132,7 +131,7 @@ export class ShelterSupplyService {
priority: SupplyPriority.UnderControl,
updatedAt: new Date().toISOString(),
},
})
});
});
}

Expand Down

0 comments on commit 0070159

Please sign in to comment.