Finish GenresAdminPanel

This commit is contained in:
2024-11-06 17:55:18 +01:00
parent 80dd2a0ae8
commit 9ec8e382cf
17 changed files with 181 additions and 21 deletions

View File

@@ -1,7 +1,22 @@
import axios from "axios"
import { GenreModel } from "../models/acts/genreModel"
let BASE_URL = "http://localhost:3000/genres"
export async function fetchAllGenres() {
return await axios.get(BASE_URL)
}
export async function postGenre(genre: GenreModel) {
return await axios.post(BASE_URL, genre)
}
export async function patchGenre(genre: GenreModel) {
return await axios.patch(BASE_URL, genre)
}
export async function deleteGenre(genre: GenreModel) {
return await axios.delete(BASE_URL, {
data: genre
})
}