Fix code review items: atomic qty increment, unit updatedAt, suppliers/all endpoint, SKU unique index
This commit is contained in:
@@ -73,6 +73,11 @@ export const inventoryRoutes: FastifyPluginAsync = async (app) => {
|
||||
return reply.send(result)
|
||||
})
|
||||
|
||||
app.get('/suppliers/all', { preHandler: [app.authenticate, app.requirePermission('inventory.view')] }, async (request, reply) => {
|
||||
const rows = await SupplierService.listAll(app.db)
|
||||
return reply.send({ data: rows })
|
||||
})
|
||||
|
||||
app.get('/suppliers/:id', { preHandler: [app.authenticate, app.requirePermission('inventory.view')] }, async (request, reply) => {
|
||||
const { id } = request.params as { id: string }
|
||||
const supplier = await SupplierService.getById(app.db, id)
|
||||
|
||||
Reference in New Issue
Block a user