Skip to content

Commit

Permalink
fix: lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex4386 committed Aug 20, 2022
1 parent 8816794 commit 1afdc47
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
11 changes: 5 additions & 6 deletions src/routes/v1/admin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ const adminV1Plugin = (app: FastifyInstance, opts: FastifyPluginOptions, done: (

return mlError.sendFastify(rep);
} else {

const type = (_err.validation) ?
Meiling.V1.Error.ErrorType.INVALID_REQUEST :
Meiling.V1.Error.ErrorType.INTERNAL_SERVER_ERROR;
const type = _err.validation
? Meiling.V1.Error.ErrorType.INVALID_REQUEST
: Meiling.V1.Error.ErrorType.INTERNAL_SERVER_ERROR;

const error = new Meiling.V1.Error.MeilingError(type);
error.loadError(_err);
Expand All @@ -44,8 +43,8 @@ const adminV1Plugin = (app: FastifyInstance, opts: FastifyPluginOptions, done: (
config.node.environment === NodeEnvironment.Development
? '*'
: config?.admin?.frontend?.url
? config.admin.frontend.url
: config.frontend.url,
? config.admin.frontend.url
: config.frontend.url,
});

app.addHook('onRequest', (req, rep, next) => {
Expand Down
7 changes: 3 additions & 4 deletions src/routes/v1/meiling/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ function meilingV1Plugin(app: FastifyInstance, opts: FastifyPluginOptions, done:

return mlError.sendFastify(rep);
} else {

const type = (_err.validation) ?
Meiling.V1.Error.ErrorType.INVALID_REQUEST :
Meiling.V1.Error.ErrorType.INTERNAL_SERVER_ERROR;
const type = _err.validation
? Meiling.V1.Error.ErrorType.INVALID_REQUEST
: Meiling.V1.Error.ErrorType.INTERNAL_SERVER_ERROR;

const error = new Meiling.V1.Error.MeilingError(type);
error.loadError(_err);
Expand Down

0 comments on commit 1afdc47

Please sign in to comment.