Skip to content

Commit 2bf5786

Browse files
committed
makeFindMixin, set variables for requested and loaded
1 parent cf5fdf4 commit 2bf5786

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/make-find-mixin.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ export default function makeFindMixin(options) {
156156
}
157157
},
158158
[FIND_ACTION](params) {
159+
const serviceName = this[SERVICE_NAME]
159160
const paramsToUse = getParams({
160161
providedParams: params,
161162
params: this[PARAMS],
@@ -168,17 +169,19 @@ export default function makeFindMixin(options) {
168169
: this[QUERY_WHEN]
169170

170171
if (shouldExecuteQuery) {
171-
this[IS_FIND_PENDING] = true
172-
173172
if (paramsToUse) {
173+
// Set the qid.
174174
paramsToUse.query = paramsToUse.query || {}
175175
paramsToUse.qid = paramsToUse.qid || this[QID]
176176
this[QID] = paramsToUse.qid
177177

178-
const serviceName = this[SERVICE_NAME]
178+
this[IS_FIND_PENDING] = true
179+
this[HAVE_ITEMS_BEEN_REQUESTED_ONCE] = true
180+
179181
return this.$store
180182
.dispatch(`${serviceName}/find`, paramsToUse)
181183
.then(response => {
184+
this[HAVE_ITEMS_LOADED_ONCE] = true
182185
const queryInfo = getQueryInfo(paramsToUse, response)
183186
// @ts-ignore
184187
queryInfo.response = response

0 commit comments

Comments
 (0)