Bugfix. .then() expects a function

This commit is contained in:
Petros Aggelatos 2013-12-31 06:41:05 +00:00 committed by Pablo Carranza Vélez
parent 117251bbc1
commit 94395c7e12

View File

@ -58,13 +58,15 @@ module.exports = (uuid) ->
).then(->
console.log('Finishing bootstrapping')
Promise.all([
knex('config').truncate().then(config).then((config) ->
knex('config').insert([
{key: 'uuid', value: uuid}
{key: 'apiKey', value: config.apiKey}
{key: 'username', value: config.username}
{key: 'userId', value: config.userId}
])
knex('config').truncate().then(->
config.then((config) ->
knex('config').insert([
{key: 'uuid', value: uuid}
{key: 'apiKey', value: config.apiKey}
{key: 'username', value: config.username}
{key: 'userId', value: config.userId}
])
)
)
knex('app').truncate()
])