Update all for Postgres and new techniques

This commit is contained in:
Sebastián Ramírez
2019-02-23 18:44:29 +04:00
parent 1b4d244033
commit 6fdba19639
72 changed files with 793 additions and 1316 deletions

View File

@@ -27,17 +27,14 @@ export const api = {
async getUsers(token: string) {
return axios.get<IUserProfile[]>(`${apiUrl}/api/v1/users/`, authHeaders(token));
},
async updateUser(token: string, name: string, data: IUserProfileUpdate) {
return axios.put(`${apiUrl}/api/v1/users/${name}`, data, authHeaders(token));
async updateUser(token: string, userId: number, data: IUserProfileUpdate) {
return axios.put(`${apiUrl}/api/v1/users/${userId}`, data, authHeaders(token));
},
async createUser(token: string, data: IUserProfileCreate) {
return axios.post(`${apiUrl}/api/v1/users/`, data, authHeaders(token));
},
async getRoles(token: string) {
return axios.get(`${apiUrl}/api/v1/roles/`, authHeaders(token));
},
async passwordRecovery(username: string) {
return axios.post(`${apiUrl}/api/v1/password-recovery/${username}`);
async passwordRecovery(email: string) {
return axios.post(`${apiUrl}/api/v1/password-recovery/${email}`);
},
async resetPassword(password: string, token: string) {
return axios.post(`${apiUrl}/api/v1/reset-password/`, {