Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

Commit

Permalink
fix: AnnouncementCollatorApi iterable error (#86)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaël G <[email protected]>
  • Loading branch information
gaelgoth authored Oct 27, 2023
1 parent 24df174 commit c81ae81
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/sixty-forks-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@procore-oss/backstage-plugin-announcements-backend': patch
---

Fix AnnouncementCollatorApi iterable error
8 changes: 7 additions & 1 deletion plugins/announcements-backend/src/search/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export type Announcement = {
created_at: string;
};

export type AnnouncementsList = {
count: number;
results: Announcement[];
};

export class AnnouncementsClient {
private readonly discoveryApi: DiscoveryApi;

Expand All @@ -30,6 +35,7 @@ export class AnnouncementsClient {
}

async announcements(): Promise<Announcement[]> {
return await this.fetch<Announcement[]>('/announcements');
const result = await this.fetch<AnnouncementsList>('/announcements');
return result?.results;
}
}

0 comments on commit c81ae81

Please sign in to comment.