Introduce prettier

This commit is contained in:
Takeshi Kimata
2024-05-19 21:04:45 +09:00
parent cbb5993276
commit 75eeebefda
89 changed files with 872 additions and 944 deletions

View File

@@ -1,14 +1,14 @@
const express = require("express");
const express = require('express');
const router = express.Router();
const defineStep = require("../../models/steps");
const defineCaseStep = require("../../models/caseSteps");
const { DataTypes, Op } = require("sequelize");
const defineStep = require('../../models/steps');
const defineCaseStep = require('../../models/caseSteps');
const { DataTypes, Op } = require('sequelize');
module.exports = function (sequelize) {
const Step = defineStep(sequelize, DataTypes);
const CaseStep = defineCaseStep(sequelize, DataTypes);
router.delete("/:stepId", async (req, res) => {
router.delete('/:stepId', async (req, res) => {
const stepId = req.params.stepId;
// TODO The caseId should not be specified from the front end, but should be traced from stepId by association.
const caseId = req.query.parentCaseId;
@@ -19,7 +19,7 @@ module.exports = function (sequelize) {
const step = await Step.findByPk(stepId);
if (!step) {
await t.rollback();
return res.status(404).send("Step not found");
return res.status(404).send('Step not found');
}
// Get caseStep to be deleted.
@@ -32,7 +32,7 @@ module.exports = function (sequelize) {
// Decrease stepNo for all caseSteps with greater than the caseStep to be deleted.
await CaseStep.update(
{ stepNo: sequelize.literal("stepNo - 1") },
{ stepNo: sequelize.literal('stepNo - 1') },
{
where: {
CaseId: caseId,
@@ -51,7 +51,7 @@ module.exports = function (sequelize) {
} catch (error) {
console.error(error);
await t.rollback();
res.status(500).send("Internal Server Error");
res.status(500).send('Internal Server Error');
}
});