Make sure to fetch all system data on load

This commit is contained in:
rijkvanzanten
2020-12-11 18:08:18 -05:00
parent 14cc248022
commit 6ebb208fd3
6 changed files with 8 additions and 6 deletions

View File

@@ -22,7 +22,7 @@ export const useCollectionsStore = createStore({
},
actions: {
async hydrate() {
const response = await api.get(`/collections`);
const response = await api.get(`/collections`, { params: { limit: -1 } });
const collections: CollectionRaw[] = response.data.data;

View File

@@ -52,7 +52,7 @@ export const useFieldsStore = createStore({
}),
actions: {
async hydrate() {
const fieldsResponse = await api.get(`/fields`);
const fieldsResponse = await api.get(`/fields`, { params: { limit: -1 } });
const fields: FieldRaw[] = fieldsResponse.data.data;

View File

@@ -11,7 +11,7 @@ export const usePermissionsStore = createStore({
}),
actions: {
async hydrate() {
const response = await api.get('/permissions/me');
const response = await api.get('/permissions/me', { params: { limit: -1 } });
this.state.permissions = response.data.data.map((rawPermission: any) => {
if (rawPermission.permissions) {

View File

@@ -109,6 +109,7 @@ export const usePresetsStore = createStore({
api.get(`/presets`, {
params: {
'filter[user][_eq]': id,
limit: -1,
},
}),
// All role saved bookmarks and presets
@@ -116,6 +117,7 @@ export const usePresetsStore = createStore({
params: {
'filter[role][_eq]': role.id,
'filter[user][_null]': true,
limit: -1,
},
}),
// All global saved bookmarks and presets
@@ -123,6 +125,7 @@ export const usePresetsStore = createStore({
params: {
'filter[role][_null]': true,
'filter[user][_null]': true,
limit: -1,
},
}),
]);

View File

@@ -10,8 +10,7 @@ export const useRelationsStore = createStore({
}),
actions: {
async hydrate() {
const response = await api.get(`/relations`);
const response = await api.get(`/relations`, { params: { limit: -1 } });
this.state.relations = response.data.data;
},
async dehydrate() {

View File

@@ -33,7 +33,7 @@ export const useServerStore = createStore({
}),
actions: {
async hydrate() {
const response = await api.get(`/server/info`);
const response = await api.get(`/server/info`, { params: { limit: -1 } });
this.state.info = response.data.data;
},
dehydrate() {