From 1ddbbd3563af77a218020021ea50a8832900b4db Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Tue, 22 Aug 2017 17:08:55 +0200 Subject: Add route logic for construction routes --- src/api/routes/users.js | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'src/api/routes/users.js') diff --git a/src/api/routes/users.js b/src/api/routes/users.js index c91e07b2..7b931d66 100644 --- a/src/api/routes/users.js +++ b/src/api/routes/users.js @@ -1,4 +1,5 @@ import {sendRequest} from "../index"; +import {deleteById, getById} from "./util"; export function getUserByEmail(email) { return sendRequest({ @@ -62,29 +63,9 @@ export function updateUser(userId, user) { } export function deleteUser(userId) { - return sendRequest({ - path: "/users/{userId}", - method: "DELETE", - parameters: { - body: {}, - path: { - userId - }, - query: {} - } - }); + return deleteById("/users/{userId}", {userId}); } export function getAuthorizationsByUser(userId) { - return sendRequest({ - path: "/users/{userId}/authorizations", - method: "GET", - parameters: { - body: {}, - path: { - userId - }, - query: {} - } - }); + return getById("/users/{userId}/authorizations", {userId}); } -- cgit v1.2.3