From fa66ac7596fec7a293f72480bdd6827017facfe9 Mon Sep 17 00:00:00 2001 From: Mathieu Geissler Date: Tue, 21 Feb 2017 15:01:20 +0100 Subject: [PATCH] Bugfix : check id is unedfined When the id is a number and is equal to 0, don't return an error response --- src/in-memory-backend.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/in-memory-backend.service.ts b/src/in-memory-backend.service.ts index 13f5340..752efaa 100644 --- a/src/in-memory-backend.service.ts +++ b/src/in-memory-backend.service.ts @@ -490,7 +490,7 @@ export class InMemoryBackendService { } protected delete({id, collection, collectionName, headers, req}: RequestInfo) { - if (!id) { + if (id == undefined) { return createErrorResponse(req, STATUS.NOT_FOUND, `Missing "${collectionName}" id`); } const exists = this.removeById(collection, id);