adding admin tools
This commit is contained in:
36
nginx/vue/src/components/admin/CreateActivity.vue
Normal file
36
nginx/vue/src/components/admin/CreateActivity.vue
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<script setup>
|
||||||
|
import Button from "@/components/input/Button.vue";
|
||||||
|
|
||||||
|
import { ref } from "vue";
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
const type = ref("");
|
||||||
|
const name = ref("");
|
||||||
|
const link = ref("");
|
||||||
|
|
||||||
|
async function post() {
|
||||||
|
try {
|
||||||
|
const res = await axios.post("/api/activity", {
|
||||||
|
type: type.value,
|
||||||
|
name: name.value,
|
||||||
|
link: link.value || undefined,
|
||||||
|
});
|
||||||
|
type.value = "";
|
||||||
|
name.value = "";
|
||||||
|
link.value = "";
|
||||||
|
console.log(res.data);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<h1>Create Activity</h1>
|
||||||
|
<input type="text" v-model="type" placeholder="Type" />
|
||||||
|
<input type="text" v-model="name" placeholder="Name" />
|
||||||
|
<input type="text" v-model="link" placeholder="Link" />
|
||||||
|
<Button @click="post">Upload</Button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
37
nginx/vue/src/components/admin/CreateFavorite.vue
Normal file
37
nginx/vue/src/components/admin/CreateFavorite.vue
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<script setup>
|
||||||
|
import Button from "@/components/input/Button.vue";
|
||||||
|
|
||||||
|
import { ref } from "vue";
|
||||||
|
import { useAuthStore } from "@/stores/auth";
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
const type = ref("");
|
||||||
|
const name = ref("");
|
||||||
|
const link = ref("");
|
||||||
|
|
||||||
|
async function post() {
|
||||||
|
try {
|
||||||
|
const res = await axios.post("/api/favorites", {
|
||||||
|
type: type.value,
|
||||||
|
name: name.value,
|
||||||
|
link: link.value || undefined,
|
||||||
|
});
|
||||||
|
type.value = "";
|
||||||
|
name.value = "";
|
||||||
|
link.value = "";
|
||||||
|
console.log(res.data);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<h1>Create Favorite</h1>
|
||||||
|
<input type="text" v-model="type" placeholder="Type" />
|
||||||
|
<input type="text" v-model="name" placeholder="Name" />
|
||||||
|
<input type="text" v-model="link" placeholder="Link" />
|
||||||
|
<Button @click="post">Upload</Button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
Reference in New Issue
Block a user