Replace Webpack with Vite (#4765)
Co-authored-by: Tom Moor <tom@getoutline.com> Co-authored-by: Vio <vio@beanon.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import invariant from "invariant";
|
||||
import { orderBy } from "lodash";
|
||||
import { lowerFirst, orderBy } from "lodash";
|
||||
import { observable, action, computed, runInAction } from "mobx";
|
||||
import { Class } from "utility-types";
|
||||
import RootStore from "~/stores/RootStore";
|
||||
@@ -20,10 +20,6 @@ export enum RPCAction {
|
||||
|
||||
type FetchPageParams = PaginationParams & Record<string, any>;
|
||||
|
||||
function modelNameFromClassName(string: string) {
|
||||
return string.charAt(0).toLowerCase() + string.slice(1);
|
||||
}
|
||||
|
||||
export const DEFAULT_PAGINATION_LIMIT = 25;
|
||||
|
||||
export const PAGINATION_SYMBOL = Symbol.for("pagination");
|
||||
@@ -61,7 +57,7 @@ export default abstract class BaseStore<T extends BaseModel> {
|
||||
constructor(rootStore: RootStore, model: Class<T>) {
|
||||
this.rootStore = rootStore;
|
||||
this.model = model;
|
||||
this.modelName = modelNameFromClassName(model.name);
|
||||
this.modelName = lowerFirst(model.name);
|
||||
|
||||
if (!this.apiEndpoint) {
|
||||
this.apiEndpoint = `${this.modelName}s`;
|
||||
|
||||
Reference in New Issue
Block a user