Skip to content

Commit

Permalink
remove /api/entities/get_raw_page endpoint (#7348)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joao-vi authored Oct 14, 2024
1 parent 6840774 commit 56bc4bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 31 deletions.
23 changes: 0 additions & 23 deletions app/api/entities/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,29 +139,6 @@ export default app => {
.catch(next)
);

app.get(
'/api/entities/get_raw_page',
validation.validateRequest({
type: 'object',
properties: {
query: {
type: 'object',
properties: {
sharedId: { type: 'string' },
pageNumber: { type: 'number' },
},
required: ['sharedId', 'pageNumber'],
},
},
required: ['query'],
}),
(req, res, next) =>
entities
.getRawPage(req.query.sharedId, req.language, req.query.pageNumber)
.then(data => res.json({ data }))
.catch(next)
);

app.get(
'/api/entities',
parseQuery,
Expand Down
14 changes: 6 additions & 8 deletions app/api/entities/specs/deprecatedRoutes.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,16 +318,14 @@ describe('entities', () => {
});
});

describe('/api/entities/get_raw_page', () => {
it('should return formattedPlainTextPages page requested', async () => {
jest.spyOn(entities, 'countByTemplate').mockImplementation(async () => Promise.resolve(2));
const req = { query: { templateId: 'templateId' } };
it('should return formattedPlainTextPages page requested', async () => {
jest.spyOn(entities, 'countByTemplate').mockImplementation(async () => Promise.resolve(2));
const req = { query: { templateId: 'templateId' } };

const response = await routes.get('/api/entities/count_by_template', req);
const response = await routes.get('/api/entities/count_by_template', req);

expect(entities.countByTemplate).toHaveBeenCalledWith('templateId');
expect(response).toEqual(2);
});
expect(entities.countByTemplate).toHaveBeenCalledWith('templateId');
expect(response).toEqual(2);
});

describe('/api/entities/count_by_template', () => {
Expand Down

0 comments on commit 56bc4bb

Please sign in to comment.