Skip to content

Commit

Permalink
refactor(mock): remove unnecessary await
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjing2222 committed Feb 24, 2025
1 parent ba4406d commit 5a368a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/mock/src/mockDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const mockDatabase =
name: "mockDatabase",
async commitBundle() {
await sleep(minMax(latency.min, latency.max));
await hooks?.onDatabaseUpdated?.();
hooks?.onDatabaseUpdated?.();
},
async updateBundle(targetBundleId: string, newBundle: Partial<Bundle>) {
await sleep(minMax(latency.min, latency.max));
Expand All @@ -36,11 +36,11 @@ export const mockDatabase =
},
async getBundleById(bundleId: string) {
await sleep(minMax(latency.min, latency.max));
return (await bundles.find((b) => b.id === bundleId)) ?? null;
return bundles.find((b) => b.id === bundleId) ?? null;
},
async getBundles() {
await sleep(minMax(latency.min, latency.max));
return await bundles.sort((a, b) => a.id.localeCompare(b.id));
return bundles.sort((a, b) => a.id.localeCompare(b.id));
},
};
};

0 comments on commit 5a368a4

Please sign in to comment.