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 { action, computed } from "mobx";
import Comment from "~/models/Comment"; import Comment from "~/models/Comment";
import RootStore from "./RootStore"; import RootStore from "./RootStore";
import Store, { RPCAction } from "./base/Store"; import Store from "./base/Store";
export default class CommentsStore extends Store<Comment> { export default class CommentsStore extends Store<Comment> {
actions = [
RPCAction.List,
RPCAction.Create,
RPCAction.Update,
RPCAction.Delete,
];
constructor(rootStore: RootStore) { constructor(rootStore: RootStore) {
super(rootStore, Comment); super(rootStore, Comment);
} }

View File

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

View File

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

View File

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