chore: Remove RPCAction.Count as default valid action on frontend (Only available for users)

This commit is contained in:
Tom Moor
2023-12-29 10:18:34 -05:00
parent 5d2a75c8e9
commit cb40e285f4
4 changed files with 12 additions and 18 deletions

View File

@@ -3,16 +3,9 @@ import orderBy from "lodash/orderBy";
import { action, computed } from "mobx";
import Comment from "~/models/Comment";
import RootStore from "./RootStore";
import Store, { RPCAction } from "./base/Store";
import Store from "./base/Store";
export default class CommentsStore extends Store<Comment> {
actions = [
RPCAction.List,
RPCAction.Create,
RPCAction.Update,
RPCAction.Delete,
];
constructor(rootStore: RootStore) {
super(rootStore, Comment);
}

View File

@@ -6,9 +6,18 @@ import { type JSONObject, UserRole } from "@shared/types";
import User from "~/models/User";
import { client } from "~/utils/ApiClient";
import RootStore from "./RootStore";
import Store from "./base/Store";
import Store, { RPCAction } from "./base/Store";
export default class UsersStore extends Store<User> {
actions = [
RPCAction.Info,
RPCAction.List,
RPCAction.Create,
RPCAction.Update,
RPCAction.Delete,
RPCAction.Count,
];
@observable
counts: {
active: number;

View File

@@ -1,16 +1,9 @@
import { computed } from "mobx";
import WebhookSubscription from "~/models/WebhookSubscription";
import RootStore from "./RootStore";
import Store, { RPCAction } from "./base/Store";
import Store from "./base/Store";
export default class WebhookSubscriptionsStore extends Store<WebhookSubscription> {
actions = [
RPCAction.List,
RPCAction.Create,
RPCAction.Delete,
RPCAction.Update,
];
constructor(rootStore: RootStore) {
super(rootStore, WebhookSubscription);
}

View File

@@ -54,7 +54,6 @@ export default abstract class Store<T extends Model> {
RPCAction.Create,
RPCAction.Update,
RPCAction.Delete,
RPCAction.Count,
];
constructor(rootStore: RootStore, model: typeof Model) {