Fix userId.

This commit is contained in:
Pierre Donias 2016-11-14 16:59:10 +01:00
parent d499332ce3
commit c0b3b3aab8

View File

@ -18,7 +18,9 @@ get.params = {
}
export async function create ({job}) {
job.userId = this.session.get('user_id')
if (!job.userId) {
job.userId = this.session.get('user_id')
}
return (await this.createJob(job)).id
}
@ -29,6 +31,7 @@ create.params = {
job: {
type: 'object',
properties: {
userId: {type: 'string', optional: true},
name: {type: 'string', optional: true},
type: {type: 'string'},
key: {type: 'string'},
@ -51,11 +54,7 @@ create.params = {
}
export async function set ({job}) {
if (!job.userId) {
job.userId = this.session.get('user_id')
}
return this.updateJob(job)
await this.updateJob(job)
}
set.permission = 'admin'
@ -65,7 +64,6 @@ set.params = {
type: 'object',
properties: {
id: {type: 'string'},
userId: {type: 'string', optional: true},
name: {type: 'string', optional: true},
type: {type: 'string'},
key: {type: 'string'},