todo-backend: review suggestions
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
"@backstage/plugin-search": "^0.3.3",
|
||||
"@backstage/plugin-tech-radar": "^0.3.7",
|
||||
"@backstage/plugin-techdocs": "^0.6.1",
|
||||
"@backstage/plugin-todo": "^0.1.1",
|
||||
"@backstage/plugin-todo": "^0.1.0",
|
||||
"@backstage/plugin-user-settings": "^0.2.7",
|
||||
"@backstage/theme": "^0.2.4",
|
||||
"@material-ui/core": "^4.11.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@backstage/plugin-todo-backend",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.0",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -74,8 +74,6 @@ export class TodoReaderService implements TodoService {
|
||||
let offset = req.offset ?? 0;
|
||||
if (offset < 0) {
|
||||
offset = 0;
|
||||
} else if (offset - limit > totalCount) {
|
||||
offset = totalCount - limit;
|
||||
}
|
||||
|
||||
let items = todos.items;
|
||||
|
||||
@@ -44,7 +44,7 @@ describe('createRouter', () => {
|
||||
jest.resetAllMocks();
|
||||
});
|
||||
|
||||
describe('GET /health', () => {
|
||||
describe('GET /todos', () => {
|
||||
it('returns list without query', async () => {
|
||||
mockService.listTodos.mockResolvedValueOnce(mockListBody);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@backstage/plugin-todo",
|
||||
"version": "0.1.1",
|
||||
"version": "0.1.0",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
Reference in New Issue
Block a user