removed redundant getAll attribute

This commit is contained in:
Sören Oesterwind 2023-07-10 17:36:59 +02:00
parent db6df2fdc6
commit 94186a3a18
3 changed files with 4 additions and 14 deletions

View File

@ -14,12 +14,7 @@ async function get(req: Request, res: Response) {
req.query.search = ''; req.query.search = '';
} }
if (req.query.getAll === undefined) { if (req.query.id) {
// Check if required fields are present.
if (!req.query.id) {
res.status(400).json({ status: 'ERROR', errorcode: 'VALIDATION_ERROR', message: 'One or more required fields are missing' });
return;
}
prisma.storageLocation prisma.storageLocation
.findUnique({ .findUnique({
where: { where: {

View File

@ -14,12 +14,7 @@ async function get(req: Request, res: Response) {
if (req.query.search === undefined) { if (req.query.search === undefined) {
req.query.search = ''; req.query.search = '';
} }
if (req.query.getAll === undefined) { if (req.query.id) {
// Check if required fields are present.
if (!req.query.id) {
res.status(400).json({ status: 'ERROR', errorcode: 'VALIDATION_ERROR', message: 'One or more required fields are missing' });
return;
}
prisma.storageUnit prisma.storageUnit
.findUnique({ .findUnique({
where: { where: {

View File

@ -138,8 +138,8 @@ const itemList = $('#itemList');
const itemListUnit = $('#itemListUnit'); const itemListUnit = $('#itemListUnit');
// itemList.empty(); // itemList.empty();
itemListUnit.bootstrapTable({ url: '/api/v1/storageUnits?getAll=true', search: true, showRefresh: true, responseHandler: dataResponseHandlerUnit, sidePagination: 'server', serverSort: true, silentSort: false }); itemListUnit.bootstrapTable({ url: '/api/v1/storageUnits', search: true, showRefresh: true, responseHandler: dataResponseHandlerUnit, sidePagination: 'server', serverSort: true, silentSort: false });
itemList.bootstrapTable({ url: '/api/v1/storageLocations?getAll=true', search: true, showRefresh: true, responseHandler: dataResponseHandler, sidePagination: 'server', serverSort: true, silentSort: false }); itemList.bootstrapTable({ url: '/api/v1/storageLocations', search: true, showRefresh: true, responseHandler: dataResponseHandler, sidePagination: 'server', serverSort: true, silentSort: false });
setTimeout(() => { setTimeout(() => {
activateTooltips(); activateTooltips();
}, 1000); }, 1000);