chore: Fix some eslint issues in routers

/puter/packages/backend/src/routers/open_item.js
  48:10  error  Unexpected negating the left operand of 'instanceof' operator  no-unsafe-negation

/puter/packages/backend/src/routers/save_account.js
  106:34  error  'get_user' is not defined   no-undef

/puter/packages/backend/src/routers/sign.js
  37:10  error  Unexpected negating the left operand of 'instanceof' operator  no-unsafe-negation
This commit is contained in:
Sam Atkins 2024-04-25 17:53:30 +01:00
parent 0c0846eef9
commit ca3f9a823d
3 changed files with 3 additions and 3 deletions

View File

@ -45,7 +45,7 @@ module.exports = eggspress('/open_item', {
const subject = req.values.subject;
const actor = Context.get('actor');
if ( ! actor.type instanceof UserActorType ) {
if ( ! (actor.type instanceof UserActorType) ) {
throw APIError.create('forbidden');
}

View File

@ -19,7 +19,7 @@
"use strict"
const express = require('express');
const router = new express.Router();
const {get_taskbar_items, username_exists, send_email_verification_code, send_email_verification_token, invalidate_cached_user} = require('../helpers');
const {get_taskbar_items, username_exists, send_email_verification_code, send_email_verification_token, invalidate_cached_user, get_user } = require('../helpers');
const auth = require('../middleware/auth.js');
const config = require('../config');
const { Context } = require('../util/context');

View File

@ -34,7 +34,7 @@ module.exports = eggspress('/sign', {
allowedMethods: ['POST'],
}, async (req, res, next)=>{
const actor = Context.get('actor');
if ( ! actor.type instanceof UserActorType ) {
if ( ! (actor.type instanceof UserActorType) ) {
throw APIError.create('forbidden');
}