mirror of
https://github.com/outline/outline.git
synced 2026-11-22 14:01:41 +03:00
* Upgrade Mobx * fix: Enforce MobX action boundaries * fix: Wrap static observable updates in actions * Remove iteration tests
31 lines
712 B
TypeScript
31 lines
712 B
TypeScript
import { observable } from "mobx";
|
|
import type { CollectionPermission } from "@shared/types";
|
|
import Collection from "./Collection";
|
|
import User from "./User";
|
|
import Model from "./base/Model";
|
|
import Relation from "./decorators/Relation";
|
|
|
|
class Membership extends Model {
|
|
static modelName = "Membership";
|
|
|
|
constructor(fields: Record<string, unknown>, store: Model["store"]) {
|
|
super(fields, store);
|
|
this.initialize(fields);
|
|
}
|
|
|
|
userId: string;
|
|
|
|
@Relation(() => User, { onDelete: "cascade" })
|
|
user: User;
|
|
|
|
collectionId: string;
|
|
|
|
@Relation(() => Collection, { onDelete: "cascade" })
|
|
collection: Collection;
|
|
|
|
@observable
|
|
permission: CollectionPermission;
|
|
}
|
|
|
|
export default Membership;
|