create quote

This commit is contained in:
Settel 2021-10-16 21:21:59 +02:00
parent fd8aaeef78
commit a6b6d1dfd6
3 changed files with 14 additions and 2 deletions

View File

@ -20,11 +20,12 @@ export default {
},
save() {
console.log('save')
this.$engine.saveQuote(":new:", this.quote.quote)
// this.$engine.createQuote(this.quote.quote)
// this.$engine.saveQuote(this.quote.id, this.quote.quote)
// this.$engine.removeQuote(this.quote.id)
},
remove() {
console.log('remove')
this.$engine.removeQuote(this.quote.id)
},
},
}

View File

@ -0,0 +1,9 @@
export default async function(quote) {
const { store } = this.context
await this.callApi('/api/saveQuote', {
g: store.state.engine.user?.game,
id: ':new:',
quote,
})
}

View File

@ -12,6 +12,7 @@ import parseSyncData from './parseSyncData'
import saveSelection from './saveSelection'
import getMyQuotes from './getMyQuotes'
import saveQuote from './saveQuote'
import createQuote from './createQuote'
import removeQuote from './removeQuote'
export default (context, inject) => {
@ -29,6 +30,7 @@ export default (context, inject) => {
collectQuotes,
getMyQuotes,
saveQuote,
createQuote,
removeQuote,
startGame,
resetGame,