Skip to content

Commit

Permalink
change parameter for remove file
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejandro-Gonzalez committed Feb 13, 2020
1 parent 262a86a commit 7d371b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/sls-api-file-delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class SlsApiFileDelete extends API {
throw new SlsApiFileDeleteError(SlsApiFileDeleteError.messages.FILE_RECORD_NOT_FOUND);
}

await this.modelInstance.remove(filtersParams);
await this.modelInstance.remove({ id: fileId });

try {
await S3.deleteObject({ Bucket: this.bucket, Key: record.path });
Expand Down
8 changes: 2 additions & 6 deletions tests/sls-api-file-delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,7 @@ describe('SlsApiFileDelete', () => {
filters: { test: 1, id: 2 }
});

sandbox.assert.calledWithExactly(BaseModel.prototype.remove, {
filters: { test: 1, id: 2 }
});
sandbox.assert.calledWithExactly(BaseModel.prototype.remove, { id: 2 });

sandbox.assert.calledWithExactly(S3.deleteObject, {
Bucket: 'test',
Expand Down Expand Up @@ -205,9 +203,7 @@ describe('SlsApiFileDelete', () => {
filters: { test: 1, id: 2 }
});

sandbox.assert.calledWithExactly(BaseModel.prototype.remove, {
filters: { test: 1, id: 2 }
});
sandbox.assert.calledWithExactly(BaseModel.prototype.remove, { id: 2 });

sandbox.assert.calledWithExactly(S3.deleteObject, {
Bucket: 'test',
Expand Down

0 comments on commit 7d371b9

Please sign in to comment.