Fix formatting
This commit is contained in:
		@@ -95,7 +95,7 @@ async function post(req: Request, res: Response) {
 | 
				
			|||||||
			.create({
 | 
								.create({
 | 
				
			||||||
				data: {
 | 
									data: {
 | 
				
			||||||
					name: value.name,
 | 
										name: value.name,
 | 
				
			||||||
					code: (value.code === '0000') ? null : value.code
 | 
										code: value.code === '0000' ? null : value.code
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				select: {
 | 
									select: {
 | 
				
			||||||
					id: true
 | 
										id: true
 | 
				
			||||||
@@ -125,7 +125,7 @@ async function patch(req: Request, res: Response) {
 | 
				
			|||||||
				},
 | 
									},
 | 
				
			||||||
				data: {
 | 
									data: {
 | 
				
			||||||
					name: value.name,
 | 
										name: value.name,
 | 
				
			||||||
					code: (value.code === '0000') ? null : value.code
 | 
										code: value.code === '0000' ? null : value.code
 | 
				
			||||||
				},
 | 
									},
 | 
				
			||||||
				select: {
 | 
									select: {
 | 
				
			||||||
					id: true
 | 
										id: true
 | 
				
			||||||
@@ -156,7 +156,8 @@ async function del(req: Request, res: Response) {
 | 
				
			|||||||
			})
 | 
								})
 | 
				
			||||||
			.then((result) => {
 | 
								.then((result) => {
 | 
				
			||||||
				res.status(200).json({ status: 'DELETED', message: 'Successfully deleted user', id: result.id });
 | 
									res.status(200).json({ status: 'DELETED', message: 'Successfully deleted user', id: result.id });
 | 
				
			||||||
			}).catch((err) => {
 | 
								})
 | 
				
			||||||
 | 
								.catch((err) => {
 | 
				
			||||||
				handlePrismaError(err, res, 'DEL user');
 | 
									handlePrismaError(err, res, 'DEL user');
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,8 +1,7 @@
 | 
				
			|||||||
import express from 'express';
 | 
					import express from 'express';
 | 
				
			||||||
import path from 'node:path';
 | 
					import path from 'node:path';
 | 
				
			||||||
import __path from "../handlers/path.js";
 | 
					import __path from '../handlers/path.js';
 | 
				
			||||||
import log from "../handlers/log.js";
 | 
					import log from '../handlers/log.js';
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
// Route imports
 | 
					// Route imports
 | 
				
			||||||
import frontend_routes from './frontend/index.js';
 | 
					import frontend_routes from './frontend/index.js';
 | 
				
			||||||
@@ -12,7 +11,7 @@ const Router = express.Router({ strict: false });
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// static / libs routes
 | 
					// static / libs routes
 | 
				
			||||||
Router.use('/static', express.static(__path + '/static'));
 | 
					Router.use('/static', express.static(__path + '/static'));
 | 
				
			||||||
Router.use('/libs/bulma', express.static(path.join(__path, 'node_modules', 'bulma', 'css'))); // http://192.168.221.10:3000/libs/bulma/bulma.css
 | 
					Router.use('/libs/bulma', express.static(path.join(__path, 'node_modules', 'bulma', 'css'))); // /libs/bulma/bulma.css
 | 
				
			||||||
Router.use('/libs/jquery', express.static(path.join(__path, 'node_modules', 'jquery', 'dist')));
 | 
					Router.use('/libs/jquery', express.static(path.join(__path, 'node_modules', 'jquery', 'dist')));
 | 
				
			||||||
Router.use('/libs/bootstrap-icons', express.static(path.join(__path, 'node_modules', 'bootstrap-icons')));
 | 
					Router.use('/libs/bootstrap-icons', express.static(path.join(__path, 'node_modules', 'bootstrap-icons')));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -20,7 +19,6 @@ Router.use('/libs/bootstrap-icons', express.static(path.join(__path, 'node_modul
 | 
				
			|||||||
Router.use('/api', api_routes);
 | 
					Router.use('/api', api_routes);
 | 
				
			||||||
Router.use('/', frontend_routes);
 | 
					Router.use('/', frontend_routes);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
// Default route.
 | 
					// Default route.
 | 
				
			||||||
Router.all('*', function (req, res) {
 | 
					Router.all('*', function (req, res) {
 | 
				
			||||||
	// TODO: Respond based on content-type (with req.is('application/json'))
 | 
						// TODO: Respond based on content-type (with req.is('application/json'))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user