2
Good afternoon my friends, all in peace?
I’m having to migrate a small API to Prisma by removing Typeorm. Well, so far I have been able to install and run smoothly, MAS (normal, kkkk). I noticed that when fiddling with a WHERE for example, I am required to restart Docker to test the change.
For example, your saving the code below will work smoothly and return the JSON:
import { Router } from 'express';
import { PrismaClient } from '@prisma/client';
// import { GetPriceListService } from '@services/commercial/price-lists/get';
const routes = Router();
routes.get('/:price_list_id/status', async (request, response) => {
//
const prisma = new PrismaClient();
const result = await prisma.price_lists.findFirst({
where: {
id: request.params.price_list_id,
// status: 'aaaaa',
},
});
//
return response.json(result);
});
export default routes;
But to add a new 'status' filter in WHERE, I save the file, I get the notification in the cosole that the memso has been changed:
backend | [INFO] 15:26:43 Restarting: /home/node/app/src/routes/commercial/price-lists/status.ts has been modified
but it doesn’t work, I have to reset the container, to apply the change.
my package.json start script, is like this:
"dev:server": "ts-node-dev --inspect --transpile-only --ignore node_modules -r tsconfig-paths/register src/server.ts"
From now on, thank you very much!!!