Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove /api/entities/get_raw_page endpoint #7348

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading