Add promote / demote user to admin and reintroduce create user dashboard
Some checks failed
Deploy with Docker Compose / deploy (push) Failing after 24s

This commit is contained in:
2026-03-10 12:17:07 +00:00
parent c7dbf5b778
commit 78d6c3d4f0
4 changed files with 69 additions and 0 deletions

View File

@@ -59,6 +59,16 @@ export const useAuthStore = defineStore("auth", () => {
}
}
async function setUserAdmin(userId, admin) {
try {
const res = await axios.patch(`/api/user/${userId}/admin`, { admin });
return res.data;
} catch (err) {
console.error(err);
throw err;
}
}
return {
user,
@@ -69,5 +79,6 @@ export const useAuthStore = defineStore("auth", () => {
refreshToken,
logOut,
createUser,
setUserAdmin,
};
});

View File

@@ -8,6 +8,7 @@ import CreatePost from "./CreatePost.vue";
import CreateFavorite from "./CreateFavorite.vue";
import CreateActivity from "./CreateActivity.vue";
import CreateRowing from "./CreateRowing.vue";
import ManageUsers from "./ManageUsers.vue";
const auth = useAuthStore();
</script>
@@ -21,6 +22,7 @@ const auth = useAuthStore();
<CreateFavorite class="bdr-2 bg-bg_primary" v-if="auth.loggedIn" />
<CreateActivity class="bdr-2 bg-bg_primary" v-if="auth.loggedIn" />
<CreateRowing class="bdr-2 bg-bg_primary" v-if="auth.loggedIn" />
<ManageUsers class="bdr-2 bg-bg_primary" v-if="auth.loggedIn" />
</div>
</main>
</template>