create quote
This commit is contained in:
parent
fd8aaeef78
commit
a6b6d1dfd6
@ -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)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
9
client/src/plugins/engine/createQuote.js
Normal file
9
client/src/plugins/engine/createQuote.js
Normal 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,
|
||||
})
|
||||
}
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user