Skip to content

Commit

Permalink
Fixed cache
Browse files Browse the repository at this point in the history
  • Loading branch information
hkirat committed Mar 23, 2024
1 parent 6853254 commit 128f8c2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/utiles/appx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,12 @@ export async function getPurchases(email: string) {
});

if (coursesFromDb && coursesFromDb.length) {
Cache.getInstance().set('courses', [email], coursesFromDb, 60 * 60);
return [...coursesFromDb, ...courses.filter((x) => x.openToEveryone)];
const allCourses = [
...coursesFromDb,
...courses.filter((x) => x.openToEveryone),
];
Cache.getInstance().set('courses', [email], allCourses, 60 * 60);
return allCourses;
}

const baseUrl = `${APPX_BASE_API}/get/checkemailforpurchase`;
Expand Down

0 comments on commit 128f8c2

Please sign in to comment.