diff --git a/software/backend/routes/account.routes.ts b/software/backend/routes/account.routes.ts index b3342a4..e703a89 100644 --- a/software/backend/routes/account.routes.ts +++ b/software/backend/routes/account.routes.ts @@ -8,6 +8,15 @@ import { Exercise } from "../models/exercises/exercise.model"; export const account = Router() +account.get("/", (req: Request, res: Response) => { + Account.findAll({ + include: [ AccountRole ] + }) + .then(accounts => { + res.status(200).json(accounts) + }) +}) + // Login user account.post("/login", (req: Request, res: Response) => { Account.findOne({ diff --git a/software/src/data/api/accountApi.ts b/software/src/data/api/accountApi.ts index 8394f3a..2efc97f 100644 --- a/software/src/data/api/accountApi.ts +++ b/software/src/data/api/accountApi.ts @@ -3,6 +3,10 @@ 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 loginAccount(username: string, password: string) { return await axios.post(BASE_URL + "/login", { username: username, diff --git a/software/src/pages/admin/dashboardPage/index.vue b/software/src/pages/admin/dashboardPage/index.vue index 717f88e..f07125a 100644 --- a/software/src/pages/admin/dashboardPage/index.vue +++ b/software/src/pages/admin/dashboardPage/index.vue @@ -24,6 +24,7 @@ exerciseStore.solveExercise(2, 1) bandStore.getBands() locationStore.getLocations() genreStore.getGenres() +accountStore.getAllAccounts() concertStore.getConcerts() .then(result => { for(let concert of concertStore.concerts) { @@ -106,13 +107,24 @@ concertStore.getConcerts() :title="$t('account.account', 2)" icon="mdi-account" > +