Skip to content

getTests not refreshes, when testsUpdate occured #19

Closed
@tjunussov

Description

@tjunussov

VUEX version,
Update not working as ADD if not found, but DEXIE's put works

if I call testsAdd, getTests refreshes data! OK!
but if i call testsUpdate for new Test( in my case InsertOrUpdate ) getTests not being refreshed

I think we could add this in mutations section

[types[`${NAME}_UPDATE`]] (state, entity) {
	const index = state.collection.findIndex(e => e[_id] == entity[_id])
	if(index > -1){
		console.debug("UPDATEING");
		state.collection = [ ...state.collection.slice(0, index), entity , ...state.collection.slice(index+1) ]
	} else {
		console.debug("ADDING");
		state.collection = [ ...state.collection, entity ]
	}
	state.loading = true
},

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions