Skip to content

Commit

Permalink
Auto-fix linting issues
Browse files Browse the repository at this point in the history
Signed-off-by: JuiceShopBot <[email protected]>
  • Loading branch information
JuiceShopBot committed Mar 19, 2022
1 parent 0dafb3d commit 9afb972
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
34 changes: 17 additions & 17 deletions models/relations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ const relationsInit = (_sequelize: Sequelize) => {
AddressModel.belongsTo(UserModel, {
constraints: true,
foreignKeyConstraint: true,
foreignKey:{
foreignKey: {
name: 'UserId'
}
})

BasketModel.belongsTo(UserModel, {
constraints: true,
foreignKeyConstraint: true,
foreignKey:{
foreignKey: {
name: 'UserId'
}
})
Expand All @@ -44,43 +44,43 @@ const relationsInit = (_sequelize: Sequelize) => {
CardModel.belongsTo(UserModel, {
constraints: true,
foreignKeyConstraint: true,
foreignKey:{
foreignKey: {
name: 'UserId'
}
})

ComplaintModel.belongsTo(UserModel, {
constraints: true,
foreignKeyConstraint: true,
foreignKey:{
foreignKey: {
name: 'UserId'
}
})

FeedbackModel.belongsTo(UserModel,{
foreignKey:{
FeedbackModel.belongsTo(UserModel, {
foreignKey: {
name: 'UserId'
}
}) // no FK constraint to allow anonymous feedback posts

ImageCaptchaModel.belongsTo(UserModel,{
foreignKey:{
ImageCaptchaModel.belongsTo(UserModel, {
foreignKey: {
name: 'UserId'
}
})

MemoryModel.belongsTo(UserModel, {
constraints: true,
foreignKeyConstraint: true,
foreignKey:{
foreignKey: {
name: 'UserId'
}
})

PrivacyRequestModel.belongsTo(UserModel, {
constraints: true,
foreignKeyConstraint: true,
foreignKey:{
foreignKey: {
name: 'UserId'
}
})
Expand All @@ -96,43 +96,43 @@ const relationsInit = (_sequelize: Sequelize) => {
QuantityModel.belongsTo(ProductModel, {
constraints: true,
foreignKeyConstraint: true,
foreignKey:{
foreignKey: {
name: 'ProductId'
}
})

RecycleModel.belongsTo(UserModel, {
constraints: true,
foreignKeyConstraint: true,
foreignKey:{
foreignKey: {
name: 'UserId'
}
})
RecycleModel.belongsTo(AddressModel, {
constraints: true,
foreignKeyConstraint: true,
foreignKey:{
foreignKey: {
name: 'AddressId'
}
})

SecurityAnswerModel.belongsTo(UserModel,{
foreignKey:{
SecurityAnswerModel.belongsTo(UserModel, {
foreignKey: {
name: 'UserId'
}
})
SecurityAnswerModel.belongsTo(SecurityQuestionModel, {
constraints: true,
foreignKeyConstraint: true,
foreignKey:{
foreignKey: {
name: 'SecurityQuestionId'
}
})

WalletModel.belongsTo(UserModel, {
constraints: true,
foreignKeyConstraint: true,
foreignKey:{
foreignKey: {
name: 'UserId'
}
})
Expand Down
4 changes: 2 additions & 2 deletions routes/fileUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function handleZipFileUpload ({ file }: Request, res: Response, next: NextFuncti
}

function checkUploadSize ({ file }: Request, res: Response, next: NextFunction) {
if(file){
if (file) {
utils.solveIf(challenges.uploadSizeChallenge, () => { return file?.size > 100000 })
}
next()
Expand All @@ -91,7 +91,7 @@ function handleXmlUpload ({ file }: Request, res: Response, next: NextFunction)
utils.solveIf(challenges.xxeFileDisclosureChallenge, () => { return (matchesSystemIniFile(xmlString) ?? matchesEtcPasswdFile(xmlString)) })
res.status(410)
next(new Error('B2B customer complaints via file upload have been deprecated for security reasons: ' + utils.trunc(xmlString, 400) + ' (' + file.originalname + ')'))
} catch (err:any) { //TODO: Remove any
} catch (err: any) { // TODO: Remove any
if (utils.contains(err.message, 'Script execution timed out')) {
if (utils.notSolved(challenges.xxeDosChallenge)) {
utils.solve(challenges.xxeDosChallenge)
Expand Down
4 changes: 2 additions & 2 deletions routes/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { UserModel } from '../models/user'
const utils = require('../lib/utils')
const challenges = require('../data/datacache').challenges

class ErrorWithParent extends Error{
class ErrorWithParent extends Error {
parent: string | undefined
}

Expand Down Expand Up @@ -63,7 +63,7 @@ module.exports = function searchProducts () {
products[i].description = req.__(products[i].description)
}
res.json(utils.queryResultToJson(products))
}).catch((error:ErrorWithParent) => {
}).catch((error: ErrorWithParent) => {
next(error.parent)
})
}
Expand Down

0 comments on commit 9afb972

Please sign in to comment.