Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
despadam committed Oct 24, 2024
1 parent 03214be commit fd27430
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 23 deletions.
6 changes: 1 addition & 5 deletions src/casl/casl-ability.factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ import { UserSettings } from "src/users/schemas/user-settings.schema";
import { User } from "src/users/schemas/user.schema";
import { Action } from "./action.enum";
import configuration from "src/config/configuration";
import {
CreateJobAuth,
UpdateJobAuth,
} from "src/jobs/types/jobs-auth.enum";

import { CreateJobAuth, UpdateJobAuth } from "src/jobs/types/jobs-auth.enum";
import { JobConfig } from "src/jobs/config/jobconfig";

type Subjects =
Expand Down
13 changes: 3 additions & 10 deletions src/jobs/config/jobconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,7 @@ export class JobConfig {
throw new Error(`No ${Action.Create} configured for job type "${type}"`);
}
if (!(Action.Update in jobData)) {
throw new Error(
`No ${Action.Update} configured for job type "${type}"`,
);
throw new Error(`No ${Action.Update} configured for job type "${type}"`);
}
const create = JobOperation.parse<CreateJobDto>(
createActions,
Expand Down Expand Up @@ -186,10 +184,7 @@ export type JobUpdateAction = JobAction<UpdateJobDto>;
* Action registration
*/
const createActions: Record<string, JobActionClass<CreateJobDto>> = {};
const updateActions: Record<
string,
JobActionClass<UpdateJobDto>
> = {};
const updateActions: Record<string, JobActionClass<UpdateJobDto>> = {};

/**
* Registers an action to handle jobs of a particular type
Expand All @@ -199,9 +194,7 @@ export function registerCreateAction(action: JobActionClass<CreateJobDto>) {
createActions[action.actionType] = action;
}

export function registerUpdateAction(
action: JobActionClass<UpdateJobDto>,
) {
export function registerUpdateAction(action: JobActionClass<UpdateJobDto>) {
updateActions[action.actionType] = action;
}

Expand Down
5 changes: 1 addition & 4 deletions src/jobs/jobs.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -694,10 +694,7 @@ export class JobsController {
throw new ForbiddenException("Unauthorized to update this job.");
}
// Update job in database
const updatedJob = await this.jobsService.update(
id,
updateJobDto,
);
const updatedJob = await this.jobsService.update(id, updateJobDto);
// Perform the action that is specified in the update portion of the job configuration
if (updatedJob !== null) {
await this.performJobUpdateAction(updatedJob);
Expand Down
5 changes: 1 addition & 4 deletions src/jobs/jobs.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ export class JobsService {
.findOneAndUpdate(
{ id: id },
addStatusFields(
addUpdatedByField(
updateJobDto as UpdateQuery<JobDocument>,
username,
),
addUpdatedByField(updateJobDto as UpdateQuery<JobDocument>, username),
updateJobDto.statusCode,
updateJobDto.statusMessage,
updateJobDto.jobResultObject,
Expand Down

0 comments on commit fd27430

Please sign in to comment.