Skip to content

Commit c8b16ff

Browse files
authored
Update service-module.md -> mutations:
add createCopy, clearCopy and updatePaginationForQuery
1 parent f8893df commit c8b16ff

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

docs/service-module.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,15 +164,21 @@ Removes a single item. `item` can be
164164
Removes the passed in items or ids from the store.
165165
- `items {Array}` - An array of ids or of objects with ids that will be removed from the data store.
166166

167-
### `setCurrent(state, item)`
167+
### `setCurrent(state, itemOrId)`
168168
- `item {Number|String|Object}` - the object with id to be set as the current item, or the id of the object in the store that should become the `current` item. Setting the `current` item or id also create the deep-cloned `copy`.
169169

170-
### `commitCopy(state)`
170+
### `createCopy(state, id)`
171+
Creates a copy of the record with the passed-in id, stores it in copiesById
172+
173+
### `commitCopy(state, id)`
171174
Saves changes from the `copy` to the `current` item.
172175

173-
### `rejectCopy(state)`
176+
### `rejectCopy(state, id)`
174177
Re-copies the data from `current` to `copy`, restoring the original copy.
175178

179+
### `clearCopy(state, id)`
180+
Removes the copy from copiesById
181+
176182
### `clearCurrent(state)`
177183
Clears the `current` item, which also clears the copy.
178184

@@ -182,6 +188,10 @@ Clears the `list`, excepting the `current` item.
182188
### `clearAll(state)`
183189
Clears all data from `ids`, `keyedById`, and `currentId`
184190

191+
### `updatePaginationForQuery(state, { qid, response, query })`
192+
Stores pagination data on state.pagination based on the query identifier (qid)
193+
The qid must be manually assigned to `params.qid`
194+
185195
### Mutations for Managing Pending State
186196
The following mutations are called automatically by the service actions, and will rarely, if ever, need to be used manually.
187197
- `setFindPending(state)` - sets `isFindPending` to `true`

0 commit comments

Comments
 (0)