mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-01-07 13:29:48 -06:00
using 201 for created entities in etapi
This commit is contained in:
@@ -6,7 +6,7 @@ Content-Type: application/json
|
||||
}
|
||||
|
||||
> {%
|
||||
client.assert(response.status === 200);
|
||||
|
||||
client.assert(response.status === 201);
|
||||
|
||||
client.global.set("authToken", response.body.authToken);
|
||||
%}
|
||||
%}
|
||||
|
||||
@@ -11,15 +11,15 @@ Content-Type: application/json
|
||||
"content": "Hi there!"
|
||||
}
|
||||
|
||||
> {%
|
||||
client.assert(response.status === 200);
|
||||
> {%
|
||||
client.assert(response.status === 201);
|
||||
client.assert(response.body.note.noteId.startsWith("forcedId"));
|
||||
client.assert(response.body.note.title == "Hello");
|
||||
client.assert(response.body.branch.branchId.startsWith("forcedId"));
|
||||
client.assert(response.body.branch.parentNoteId == "root");
|
||||
|
||||
client.log(`Created note ` + response.body.note.noteId + ` and branch ` + response.body.branch.branchId);
|
||||
|
||||
|
||||
client.global.set("createdNoteId", response.body.note.noteId);
|
||||
client.global.set("createdBranchId", response.body.branch.branchId);
|
||||
%}
|
||||
@@ -37,11 +37,11 @@ Content-Type: application/json
|
||||
}
|
||||
|
||||
> {%
|
||||
client.assert(response.status === 200);
|
||||
client.assert(response.status === 201);
|
||||
client.assert(response.body.parentNoteId == "hidden");
|
||||
|
||||
client.global.set("clonedBranchId", response.body.branchId);
|
||||
|
||||
|
||||
client.log(`Created cloned branch ` + response.body.branchId);
|
||||
%}
|
||||
|
||||
@@ -107,9 +107,9 @@ Authorization: {{authToken}}
|
||||
}
|
||||
|
||||
> {%
|
||||
client.assert(response.status === 200);
|
||||
client.assert(response.status === 201);
|
||||
client.assert(response.body.attributeId.startsWith("forcedAttributeId"));
|
||||
|
||||
|
||||
client.global.set("createdAttributeId", response.body.attributeId);
|
||||
%}
|
||||
|
||||
@@ -121,4 +121,4 @@ Authorization: {{authToken}}
|
||||
> {%
|
||||
client.assert(response.status === 200);
|
||||
client.assert(response.body.attributeId == client.global.get("createdAttributeId"));
|
||||
%}
|
||||
%}
|
||||
|
||||
@@ -6,8 +6,8 @@ Content-Type: application/json
|
||||
}
|
||||
|
||||
> {%
|
||||
client.assert(response.status === 200);
|
||||
|
||||
client.assert(response.status === 201);
|
||||
|
||||
client.global.set("testAuthToken", response.body.authToken);
|
||||
%}
|
||||
|
||||
@@ -31,4 +31,4 @@ Content-Type: application/json
|
||||
GET {{triliumHost}}/etapi/notes/root
|
||||
Authorization: {{testAuthToken}}
|
||||
|
||||
> {% client.assert(response.status === 401); %}
|
||||
> {% client.assert(response.status === 401); %}
|
||||
|
||||
Reference in New Issue
Block a user