mirror of
https://github.com/outline/outline.git
synced 2026-11-23 06:11:04 +03:00
* refactor: DRY up app stores with fetchPaginated helper and IndexedStore Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor: Resolve related models by store responseKey instead of a key map Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
17 lines
532 B
TypeScript
17 lines
532 B
TypeScript
import Star from "~/models/Star";
|
|
import type { PaginationParams } from "~/types";
|
|
import IndexedStore from "./base/IndexedStore";
|
|
import type RootStore from "./RootStore";
|
|
import type { PaginatedResponse } from "./base/Store";
|
|
|
|
export default class StarsStore extends IndexedStore<Star> {
|
|
constructor(rootStore: RootStore) {
|
|
super(rootStore, Star);
|
|
}
|
|
|
|
fetchPage = async (
|
|
params?: PaginationParams
|
|
): Promise<PaginatedResponse<Star>> =>
|
|
this.fetchPaginated("/stars.list", params, [this.rootStore.documents]);
|
|
}
|