Skip to content

Commit

Permalink
Update watched.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
koenoe committed Jan 15, 2025
1 parent ff8d9e7 commit 30b0995
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lambdas/watched.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { type AttributeValue } from '@aws-sdk/client-dynamodb';
import { unmarshall } from '@aws-sdk/util-dynamodb';

import { cachedTvSeries as _cachedTvSeries } from '@/lib/cached';
import { addToList, removeFromList } from '@/lib/db/list';
import { addToList, removeFromList, removeFromWatchlist } from '@/lib/db/list';
import { getWatchedCountForTvSeries, type WatchedItem } from '@/lib/db/watched';
import { type TvSeries } from '@/types/tv-series';

Expand Down Expand Up @@ -116,6 +116,10 @@ export const handler = async (event: DynamoDBStreamEvent) => {
listId: 'WATCHED',
id: tvSeries.id,
}),
removeFromWatchlist({
userId: item.userId,
id: tvSeries.id,
}),
addToList({
userId: item.userId,
listId: 'IN_PROGRESS',
Expand Down

0 comments on commit 30b0995

Please sign in to comment.