material editor update

This commit is contained in:
2026-08-01 20:09:18 +02:00
parent 693b7aff36
commit 7fc8012dac
33 changed files with 4406 additions and 5 deletions
@@ -0,0 +1,22 @@
import ky from 'ky'
import type { Language } from '../../data/language'
export const getLanguages = async (): Promise<Language[]> => {
return ky.get(`http://localhost:8088/languages`).json<Language[]>()
}
export const getLanguageById = async (id: number): Promise<Language> => {
return ky.get(`http://localhost:8088/language/${id}`).json<Language>()
}
export const createLanguage = async (language: Language): Promise<Language> => {
return ky.post(`http://localhost:8088/language`, { json: language }).json<Language>()
}
export const updateLanguage = async (language: Language): Promise<Language> => {
return ky.put(`http://localhost:8088/language`, { json: language }).json<Language>()
}
export const deleteLanguage = async (id: number): Promise<void> => {
return ky.delete(`http://localhost:8088/language/${id}`).json<void>()
}