Skip to content

Commit

Permalink
fix deploy search by secret
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomede committed Feb 11, 2020
1 parent cca58a7 commit 883e5cb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/controllers/Docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default new class DeployContainer {
const { secret } = req.params

try {
const deploy = await deployQuery.findDeploy(secret, req.userId)
const deploy = await deployQuery.findDeploy(secret)
const containers = await containerQuery.findContainers(deploy.id)
await actions.startDeployRoutine(actions, containers, deploy)
resp.returnSucessMessage(res, 'Implantação concluída com sucesso')
Expand Down
4 changes: 2 additions & 2 deletions api/query/deployQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { knex } from '../db/connection'
import * as I from '../interface/Interfaces'

export default new class DeployQuery {
public async findDeploy (secret: string, userId: number): Promise<I.Deploy> {
public async findDeploy (secret: string): Promise<I.Deploy> {
try {
const deploy: I.Deploy[] = await knex('deploys')
.where({ secret: secret, userIdFk: userId })
.where({ secret: secret })
.select()

return deploy[0]
Expand Down

0 comments on commit 883e5cb

Please sign in to comment.