Files
outline/app/stores/EventsStore.ts
Tom Moor bf45e97641 chore: Enforce type import consistency (#10968)
* Update types

* fix circular dep

* type imports

* lint type imports and --fix
2025-12-19 23:07:02 -05:00

21 lines
626 B
TypeScript

import Event from "~/models/Event";
import type RootStore from "./RootStore";
import Store, { RPCAction } from "./base/Store";
export default class EventsStore extends Store<Event<any>> {
actions = [RPCAction.List];
constructor(rootStore: RootStore) {
super(rootStore, Event);
}
/**
* Retrieves all events for a given document ID
*
* @param documentId - The ID of the document to retrieve events for
* @returns An array of events for the specified document ID
*/
getByDocumentId = (documentId: string): Event<any>[] =>
this.orderedData.filter((event) => event.documentId === documentId);
}