Skip to content

Commit

Permalink
feat: support r2 in usememos
Browse files Browse the repository at this point in the history
  • Loading branch information
linyibing committed Mar 13, 2024
1 parent 2201d1f commit 990d3e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/periodic/DailyRecord.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ export class DailyRecord {
return;
}

const { data } = await this.axios.get(
`${origin}/o/r/${resource.name || resource.id}`,
{
responseType: 'arraybuffer',
}
);
const resourceURL =
resource.externalLink ||
`${origin}/o/r/${resource.name || resource.id}`;
const { data } = await this.axios.get(resourceURL, {
responseType: 'arraybuffer',
});

if (!data) {
return;
Expand Down
1 change: 1 addition & 0 deletions src/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export type ContextType = {

export type ResourceType = {
name?: string;
externalLink?: string;
id: string;
filename: string;
};
Expand Down

0 comments on commit 990d3e5

Please sign in to comment.