mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-15 03:53:51 +00:00
Migrated create visit action to use payload
This commit is contained in:
@@ -56,13 +56,13 @@ export default buildReducer<ShortUrlsList, ListShortUrlsCombinedAction>({
|
||||
state,
|
||||
)),
|
||||
),
|
||||
[CREATE_VISITS]: (state, { createdVisits }) => assocPath(
|
||||
[CREATE_VISITS]: (state, { payload }) => assocPath(
|
||||
['shortUrls', 'data'],
|
||||
state.shortUrls?.data?.map(
|
||||
(currentShortUrl) => {
|
||||
// Find the last of the new visit for this short URL, and pick the amount of visits from it
|
||||
const lastVisit = last(
|
||||
createdVisits.filter(
|
||||
payload.createdVisits.filter(
|
||||
({ shortUrl }) => shortUrl && shortUrlMatches(currentShortUrl, shortUrl.shortCode, shortUrl.domain),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user