feat(datamart): included fifoindex monitor
This commit is contained in:
18
server/services/dataMart/controller/getFifoIndex.ts
Normal file
18
server/services/dataMart/controller/getFifoIndex.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { desc } from "drizzle-orm";
|
||||
import { db } from "../../../../database/dbclient.js";
|
||||
import { fifoIndex } from "../../../../database/schema/fifoIndex.js";
|
||||
|
||||
export const getFifoIndex = async () => {
|
||||
let articles: any = [];
|
||||
try {
|
||||
const res = await db
|
||||
.select()
|
||||
.from(fifoIndex)
|
||||
.orderBy(desc(fifoIndex.add_Date));
|
||||
articles = res;
|
||||
} catch (error) {
|
||||
articles = error;
|
||||
}
|
||||
|
||||
return articles;
|
||||
};
|
||||
Reference in New Issue
Block a user