@equinor/fusion
Advanced tools
Comparing version 0.1.87 to 0.1.88
@@ -20,4 +20,4 @@ import TaskType, { TaskTypes } from "./TaskType"; | ||
type: string; | ||
Name: string; | ||
Description: string; | ||
name: string; | ||
description: string; | ||
}; | ||
@@ -24,0 +24,0 @@ assignedTo: Person; |
@@ -25,4 +25,4 @@ import BaseApiClient from "./BaseApiClient"; | ||
async setTaskPriorityAsync(id, priority) { | ||
const url = this.resourceCollections.tasks.priority(id, priority); | ||
await this.httpClient.putAsync(url, null); | ||
const url = this.resourceCollections.tasks.priority(id); | ||
await this.httpClient.patchAsync(url, priority); | ||
} | ||
@@ -29,0 +29,0 @@ async refreshTasksAsync(type, refreshRequest) { |
@@ -24,2 +24,9 @@ import { HttpResponse } from "./HttpResponse"; | ||
putAsync<TBody, TResponse, TExpectedErrorResponse>(url: string, body: TBody, init?: RequestInit): Promise<HttpResponse<TResponse>>; | ||
/** | ||
* Perform a PATCH request | ||
* @param url Request url | ||
* @param body Request body (will be serialized as JSON) | ||
* @param init Optional request init object | ||
*/ | ||
patchAsync<TBody, TResponse, TExpectedErrorResponse>(url: string, body: TBody, init?: RequestInit): Promise<HttpResponse<TResponse>>; | ||
} |
@@ -19,2 +19,3 @@ import { IAuthContainer } from "../../auth/AuthContainer"; | ||
putAsync<TBody, TResponse, TExpectedErrorResponse>(url: string, body: TBody, init?: RequestInit): Promise<HttpResponse<TResponse>>; | ||
patchAsync<TBody, TResponse, TExpectedErrorResponse>(url: string, body: TBody, init?: RequestInit): Promise<HttpResponse<TResponse>>; | ||
private performFetchAsync; | ||
@@ -21,0 +22,0 @@ private parseResponseJSONAsync; |
@@ -60,2 +60,7 @@ import uuid from "uuid/v1"; | ||
} | ||
async patchAsync(url, body, init) { | ||
init = ensureRequestInit(init, init => (Object.assign({}, init, { method: "PATCH", body: JSON.stringify(body) }))); | ||
const response = await this.performFetchAsync(url, init); | ||
return await this.parseResponseAsync(init, response); | ||
} | ||
async performFetchAsync(url, init) { | ||
@@ -62,0 +67,0 @@ try { |
@@ -11,3 +11,3 @@ import BaseResourceCollection from "./BaseResourceCollection"; | ||
query(queryText: string): string; | ||
priority(id: string, priority: number): string; | ||
priority(id: string): string; | ||
} |
@@ -25,5 +25,5 @@ import BaseResourceCollection from "./BaseResourceCollection"; | ||
} | ||
priority(id, priority) { | ||
return combineUrls(this.task(id), "priority", priority.toString()); | ||
priority(id) { | ||
return combineUrls(this.task(id), "priority"); | ||
} | ||
} |
{ | ||
"name": "@equinor/fusion", | ||
"version": "0.1.87", | ||
"version": "0.1.88", | ||
"description": "Everything a Fusion app needs to communicate with the core", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
165876
3912