create quote
This commit is contained in:
parent
fd8aaeef78
commit
a6b6d1dfd6
@ -20,11 +20,12 @@ export default {
|
|||||||
},
|
},
|
||||||
save() {
|
save() {
|
||||||
console.log('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() {
|
remove() {
|
||||||
console.log('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 saveSelection from './saveSelection'
|
||||||
import getMyQuotes from './getMyQuotes'
|
import getMyQuotes from './getMyQuotes'
|
||||||
import saveQuote from './saveQuote'
|
import saveQuote from './saveQuote'
|
||||||
|
import createQuote from './createQuote'
|
||||||
import removeQuote from './removeQuote'
|
import removeQuote from './removeQuote'
|
||||||
|
|
||||||
export default (context, inject) => {
|
export default (context, inject) => {
|
||||||
@ -29,6 +30,7 @@ export default (context, inject) => {
|
|||||||
collectQuotes,
|
collectQuotes,
|
||||||
getMyQuotes,
|
getMyQuotes,
|
||||||
saveQuote,
|
saveQuote,
|
||||||
|
createQuote,
|
||||||
removeQuote,
|
removeQuote,
|
||||||
startGame,
|
startGame,
|
||||||
resetGame,
|
resetGame,
|
||||||
|
Loading…
Reference in New Issue
Block a user