Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Commit

Permalink
Removed unnecessary parentheses from values format response.
Browse files Browse the repository at this point in the history
  • Loading branch information
tim.j committed Jan 7, 2019
1 parent 75e8373 commit fd1fe90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 25 deletions.
1 change: 0 additions & 1 deletion src/values.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ describe("values", () => {
});
});


it("listValuesTransactions(value)", async () => {
const valueParams: CreateValueParams = {
id: uuid.v4().substring(0, 12),
Expand Down
32 changes: 8 additions & 24 deletions src/values.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@ export async function createValue(params: CreateValueParams): Promise<CreateValu

const resp = await lightrail.request("POST", "values").send(params);
if (isSuccessStatus(resp.status)) {
return (
formatResponse(resp)
);
return formatResponse(resp);
}

throw new LightrailRequestError(resp);
Expand All @@ -41,9 +39,7 @@ export async function createValue(params: CreateValueParams): Promise<CreateValu
export async function listValues(params?: ListValuesParams, contentType: ContentType = "application/json"): Promise<ListValuesResponse> {
const resp = await lightrail.request("GET", "values").set("accept", contentType).query(formatFilterParams(params));
if (isSuccessStatus(resp.status)) {
return (
formatResponse(resp)
);
return formatResponse(resp);
}

throw new LightrailRequestError(resp);
Expand All @@ -54,9 +50,7 @@ export async function getValue(value: string | Value, params?: GetValueParams):

const resp = await lightrail.request("GET", `values/${encodeURIComponent(valueId)}`).query(params);
if (isSuccessStatus(resp.status) || resp.status === 404) {
return (
formatResponse(resp)
);
return formatResponse(resp);
}

throw new LightrailRequestError(resp);
Expand All @@ -67,9 +61,7 @@ export async function updateValue(value: string | Value, params: UpdateValuePara

const resp = await lightrail.request("PATCH", `values/${encodeURIComponent(valueId)}`).send(params);
if (isSuccessStatus(resp.status)) {
return (
formatResponse(resp)
);
return formatResponse(resp);
}

throw new LightrailRequestError(resp);
Expand All @@ -80,9 +72,7 @@ export async function changeValuesCode(value: string | Value, params: ChangeValu

const resp = await lightrail.request("POST", `values/${encodeURIComponent(valueId)}/changeCode`).send(params);
if (isSuccessStatus(resp.status)) {
return (
formatResponse(resp)
);
return formatResponse(resp);
}

throw new LightrailRequestError(resp);
Expand All @@ -93,9 +83,7 @@ export async function deleteValue(value: string | Value): Promise<DeleteValueRes

const resp = await lightrail.request("DELETE", `values/${encodeURIComponent(valueId)}`);
if (isSuccessStatus(resp.status) || resp.status === 404) {
return (
formatResponse(resp)
);
return formatResponse(resp);
}

throw new LightrailRequestError(resp);
Expand All @@ -106,9 +94,7 @@ export async function listValuesTransactions(value: string | Value, params?: Lis

const resp = await lightrail.request("GET", `values/${encodeURIComponent(valueId)}/transactions`).query(formatFilterParams(params));
if (isSuccessStatus(resp.status)) {
return (
formatResponse(resp)
);
return formatResponse(resp);
}

throw new LightrailRequestError(resp);
Expand All @@ -119,9 +105,7 @@ export async function listValuesAttachedContacts(value: string | Value, params?:

const resp = await lightrail.request("GET", `values/${encodeURIComponent(valueId)}/contacts`).query(formatFilterParams(params));
if (isSuccessStatus(resp.status)) {
return (
formatResponse(resp)
);
return formatResponse(resp);
}

throw new LightrailRequestError(resp);
Expand Down

0 comments on commit fd1fe90

Please sign in to comment.