Skip to content

Commit

Permalink
filter out employees and equipment
Browse files Browse the repository at this point in the history
  • Loading branch information
dangowans committed Jul 29, 2024
1 parent 2ad7a26 commit a471a39
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions queries/items/getItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ const sql = `SELECT [ITMSysID] as itemSystemId,
[QtyHand] as quantityOnHand,
coalesce([ExtItem_ID], '') as externalItemId,
coalesce([Comments], '') as comments
FROM [WMITM] WITH (NOLOCK)`;
FROM [WMITM] WITH (NOLOCK)
where [Type] not in ('Employee', 'Equipment')`;
const cache = new NodeCache({
stdTTL: cacheTimeToLiveSeconds
});
Expand All @@ -46,7 +47,7 @@ export async function getItemByItemId(mssqlConfig, itemId) {
const itemResult = (await pool
.request()
.input('itemId', itemId)
.query(`${sql} where Item_ID = @itemId`));
.query(`${sql} and Item_ID = @itemId`));
if (itemResult.recordset.length === 0) {
return undefined;
}
Expand Down
5 changes: 3 additions & 2 deletions queries/items/getItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ const sql = `SELECT [ITMSysID] as itemSystemId,
[QtyHand] as quantityOnHand,
coalesce([ExtItem_ID], '') as externalItemId,
coalesce([Comments], '') as comments
FROM [WMITM] WITH (NOLOCK)`
FROM [WMITM] WITH (NOLOCK)
where [Type] not in ('Employee', 'Equipment')`

const cache = new NodeCache({
stdTTL: cacheTimeToLiveSeconds
Expand All @@ -62,7 +63,7 @@ export async function getItemByItemId(
const itemResult = (await pool
.request()
.input('itemId', itemId)
.query(`${sql} where Item_ID = @itemId`)) as IResult<ResourceItem>
.query(`${sql} and Item_ID = @itemId`)) as IResult<ResourceItem>

if (itemResult.recordset.length === 0) {
return undefined
Expand Down

0 comments on commit a471a39

Please sign in to comment.