Implemented groups

This commit is contained in:
2017-10-17 23:17:04 +02:00
parent e9b6cb3ac8
commit 63a421e6a2
15 changed files with 248 additions and 158 deletions

View File

@ -1,5 +1,15 @@
import { AnimeNotifier } from "../AnimeNotifier"
// New
export function newObject(arn: AnimeNotifier, button: HTMLButtonElement) {
let dataType = button.dataset.type
arn.post(`/api/new/${dataType}`, "")
.then(response => response.json())
.then(obj => arn.app.load(`/${dataType}/${obj.id}/edit`))
.catch(err => arn.statusMessage.showError(err))
}
// Delete
export function deleteObject(arn: AnimeNotifier, button: HTMLButtonElement) {
let confirmType = button.dataset.confirmType

View File

@ -1,9 +0,0 @@
import { AnimeNotifier } from "../AnimeNotifier"
// New soundtrack
export function newSoundTrack(arn: AnimeNotifier, button: HTMLButtonElement) {
arn.post("/api/new/soundtrack", "")
.then(response => response.json())
.then(track => arn.app.load(`/soundtrack/${track.id}/edit`))
.catch(err => arn.statusMessage.showError(err))
}