Remove async/await
This commit is contained in:
parent
9721b4bac0
commit
5361bf1ad5
@ -9,21 +9,21 @@ const getNewVal = (result) => {
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
Query: {
|
Query: {
|
||||||
async allUploads () {
|
allUploads () {
|
||||||
const db = getRethinkDB()
|
const db = getRethinkDB()
|
||||||
return await db.table('uploads')
|
return db.table('uploads')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Mutation: {
|
Mutation: {
|
||||||
async singleUpload (_, {file}) {
|
singleUpload (_, {file}) {
|
||||||
const db = getRethinkDB()
|
const db = getRethinkDB()
|
||||||
const result = await db.table('uploads')
|
const result = db.table('uploads')
|
||||||
.insert(file, {returnChanges: true})
|
.insert(file, {returnChanges: true})
|
||||||
return getNewVal(result)
|
return getNewVal(result)
|
||||||
},
|
},
|
||||||
async multiUpload (_, {files}) {
|
multiUpload (_, {files}) {
|
||||||
const db = getRethinkDB()
|
const db = getRethinkDB()
|
||||||
const result = await db.table('uploads')
|
const result = db.table('uploads')
|
||||||
.insert(files, {returnChanges: true})
|
.insert(files, {returnChanges: true})
|
||||||
return getNewVal(result)
|
return getNewVal(result)
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user