Skip to content

Commit

Permalink
only sort in getCooccurrenceId
Browse files Browse the repository at this point in the history
  • Loading branch information
Ly Cheng committed Aug 2, 2023
1 parent 0c9c0e3 commit 8c644c4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/graphql/mutations/CreateOrUpdateCooccurrence.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Cooccurrence from '../models/Cooccurrence';
import client from 'util/client';

export function getCooccurrenceId({ articleIds, userId, appId }) {
const joinedArticleIds = articleIds.join('_');
const joinedArticleIds = articleIds.sort().join('_');
return `${userId}_${appId}_${joinedArticleIds}`;
}

Expand All @@ -20,7 +20,6 @@ export async function createOrUpdateCooccurrence({ articleIds, user }) {
assertUser(user);

const now = new Date().toISOString();
articleIds.sort();
const id = getCooccurrenceId({
articleIds,
userId: user.id,
Expand Down

0 comments on commit 8c644c4

Please sign in to comment.