Comparing version 0.6.8 to 0.6.9
@@ -9,2 +9,7 @@ import { APIGroup, LinkedObject } from "./common"; | ||
} | ||
export interface NotePayload { | ||
Type: NoteType; | ||
Title: string; | ||
Text: string; | ||
} | ||
export declare class Api extends APIGroup { | ||
@@ -23,3 +28,3 @@ /** | ||
*/ | ||
add(thing: LinkedObject, note: Note): Promise<void>; | ||
add(thing: LinkedObject, note: NotePayload): Promise<void>; | ||
/** | ||
@@ -26,0 +31,0 @@ * List notes for a resource |
@@ -30,8 +30,8 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const selfLink = thing.Links.filter(link => link.Rel == "self"); | ||
if (selfLink.length !== 1) { | ||
const selfLink = thing.Links.find(link => link.Rel == "self"); | ||
if (!selfLink) { | ||
throw new Error("Unable to find self-link for given object"); | ||
} | ||
try { | ||
yield this.axios.post(`${selfLink[0]}/notes`, note); | ||
yield this.axios.post(`${selfLink}/notes`, note); | ||
} | ||
@@ -38,0 +38,0 @@ catch (error) { |
{ | ||
"name": "tigerbay", | ||
"version": "0.6.8", | ||
"version": "0.6.9", | ||
"description": "API Client library for TigerBay", | ||
@@ -5,0 +5,0 @@ "main": "lib/client.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79693
1978