Fix groups index being updated when a new group is created
This commit is contained in:
parent
8d67556bdf
commit
3d1c0fa813
2 changed files with 2 additions and 2 deletions
|
@ -11,7 +11,7 @@ const updateStore = (store: EntityStore, entities: Entity[]): EntityStore => {
|
|||
/** Update the list with new entity IDs. */
|
||||
const updateList = (list: EntityList, entities: Entity[]): EntityList => {
|
||||
const newIds = entities.map(entity => entity.id);
|
||||
const ids = new Set([...Array.from(list.ids), ...newIds]);
|
||||
const ids = new Set([...newIds, ...Array.from(list.ids)]);
|
||||
|
||||
if (typeof list.state.totalCount === 'number') {
|
||||
const sizeDiff = ids.size - list.ids.size;
|
||||
|
|
|
@ -16,7 +16,7 @@ interface CreateGroupParams {
|
|||
function useCreateGroup() {
|
||||
const api = useApi();
|
||||
|
||||
const { createEntity, ...rest } = useCreateEntity([Entities.GROUPS], (params: CreateGroupParams) => {
|
||||
const { createEntity, ...rest } = useCreateEntity([Entities.GROUPS, 'search', ''], (params: CreateGroupParams) => {
|
||||
return api.post('/api/v1/groups', params, {
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data',
|
||||
|
|
Loading…
Reference in a new issue