refs #6531 feat:modify name
gitea/salix/pipeline/pr-test This commit looks good Details

This commit is contained in:
Sergio De la torre 2024-02-19 09:17:57 +01:00
parent 5b541aa804
commit adeca2bb22
2 changed files with 35 additions and 35 deletions

View File

@ -7,12 +7,12 @@ module.exports = Self => {
root: true root: true
}, },
http: { http: {
path: `/getLastTicketsByWorker`, path: `/myLastModified`,
verb: 'GET' verb: 'GET'
} }
}); });
Self.getLastTicketsByWorker = async ctx => { Self.myLastModified = async ctx => {
const userId = ctx.req.accessToken.userId; const userId = ctx.req.accessToken.userId;
const query = const query =
`SELECT ticketFk, MAX(created) created `SELECT ticketFk, MAX(created) created

View File

@ -1,9 +1,9 @@
const {models} = require('vn-loopback/server/server'); const {models} = require('vn-loopback/server/server');
describe('getLastTicketsByWorker()', () => { describe('myLastModified()', () => {
it('return list of last tickets which user has modified', async() => { it('return list of last tickets which user has modified', async() => {
let ctx = {req: {accessToken: {userId: 100}}}; let ctx = {req: {accessToken: {userId: 100}}};
let response = await models.Ticket.getLastTicketsByWorker(ctx); let response = await models.Ticket.myLastModified(ctx);
expect(response.length).toBeGreaterThan(0); expect(response.length).toBeGreaterThan(0);
}); });