Skip to content

Commit

Permalink
fix: correct computation of attachment url
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed Sep 16, 2020
1 parent 85946be commit 4cf5f94
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/base/BaseRocDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default abstract class BaseRocDocument {
return {
...attachments[name],
name,
url: `${this.getBaseUrl()}${doc._id}/${name}`,
url: `${this.getBaseUrl()}${name}`,
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/fake/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export class FakeDocument extends BaseRocDocument {
}

protected getBaseUrl() {
return `https://${this.roc.fakeHost}/db/${this.roc.fakeDatabase}/entry/`;
return `https://${this.roc.fakeHost}/db/${this.roc.fakeDatabase}/entry/${this.uuid}/`;
}

private saveAttachment(uuid: string, name: string, data: Buffer | string) {
Expand Down

0 comments on commit 4cf5f94

Please sign in to comment.