From 6fa04a38fcb9fb7e2454d3d5902d7c89ab44822e Mon Sep 17 00:00:00 2001 From: Stanimir Marinov Date: Wed, 22 Nov 2017 14:34:28 +0200 Subject: [PATCH] handle no content status https://httpstatuses.com/204 --- templates/react-class.mustache | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/react-class.mustache b/templates/react-class.mustache index 66b7751f..10304a3a 100644 --- a/templates/react-class.mustache +++ b/templates/react-class.mustache @@ -77,7 +77,8 @@ let {{&className}} = (function(){ headers, body: JSON.stringify(body) }).then((response) => { - return response.json(); + if(response.status === 204) return response.text(); + else return response.json(); }).then((body) => { deferred.resolve(body); }).catch((error) => {