From 9e3567e4cc8567fe35b42b612c0e1d3ac1d9394b Mon Sep 17 00:00:00 2001 From: bourgeoa Date: Sun, 21 Aug 2022 19:28:12 +0200 Subject: [PATCH] default content for rdf+xml --- sourcePane.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sourcePane.js b/sourcePane.js index 4ea25c2..0818d8b 100644 --- a/sourcePane.js +++ b/sourcePane.js @@ -51,10 +51,17 @@ module.exports = { throw new Error(msg) } + function contentForNew (contentType) { + let content = '\n' + if (contentType.includes('json')) content = '{}\n' + else if (contentType.includes('rdf+xml')) content = '\n\n' + return content + } + return new Promise(function (resolve, reject) { kb.fetcher .webOperation('PUT', newInstance.uri, { - data: contentType.includes('json') ? '{}\n' : '\n', + data: contentForNew(contentType), contentType: contentType }) .then(