Move software files one directory up, Readme

This commit is contained in:
2024-11-19 16:51:28 +01:00
parent 9fa2b753ec
commit b347df7c6e
329 changed files with 255 additions and 31 deletions

View File

@@ -0,0 +1,36 @@
import axios from "axios"
import { AccountModel } from "../models/user/accountModel"
const BASE_URL = "http://localhost:3000/accounts"
export async function fetchAllAccounts() {
return await axios.get(BASE_URL)
}
export async function login(username: string, password: string) {
return await axios.get(BASE_URL + "/login?username=" + username + "&password=" + password)
}
export async function getAccount(token: string) {
return await axios.get(BASE_URL + "/account", {
headers: {
"Authorization": token
}
})
}
export async function registerAccount(account: AccountModel) {
return await axios.post(BASE_URL, account)
}
export async function updateAccount(account: AccountModel, token: string) {
return await axios.patch(BASE_URL, account, {
headers: {
"Authorization": token
}
})
}
export async function deleteAccount(account: AccountModel) {
return await axios.delete(BASE_URL + "/" + account.id)
}