diff --git a/packages/api/src/jobs/rss/refreshFeed.ts b/packages/api/src/jobs/rss/refreshFeed.ts index dba8ed535..ccefcd0d5 100644 --- a/packages/api/src/jobs/rss/refreshFeed.ts +++ b/packages/api/src/jobs/rss/refreshFeed.ts @@ -617,7 +617,6 @@ const processSubscription = async ( // update subscription lastFetchedAt const updatedSubscription = await updateSubscription(userId, subscriptionId, { - id: subscriptionId, lastFetchedAt: lastItemFetchedAt, lastFetchedChecksum: updatedLastFetchedChecksum, scheduledAt: new Date(nextScheduledAt), diff --git a/packages/api/src/services/update_subscription.ts b/packages/api/src/services/update_subscription.ts index 33f9cdfb0..70da2cfe0 100644 --- a/packages/api/src/services/update_subscription.ts +++ b/packages/api/src/services/update_subscription.ts @@ -1,5 +1,8 @@ import { Subscription } from '../entity/subscription' -import { UpdateSubscriptionInput } from '../generated/graphql' +import { + SubscriptionStatus, + UpdateSubscriptionInput, +} from '../generated/graphql' import { getRepository } from '../repository' const ensureOwns = async (userId: string, subscriptionId: string) => { @@ -14,10 +17,23 @@ const ensureOwns = async (userId: string, subscriptionId: string) => { } } +type UpdateSubscriptionData = { + autoAddToLibrary?: boolean | null + description?: string | null + fetchContent?: boolean | null + folder?: string | null + isPrivate?: boolean | null + lastFetchedAt?: Date | null + lastFetchedChecksum?: string | null + name?: string | null + scheduledAt?: Date | null + status?: SubscriptionStatus | null +} + export const updateSubscription = async ( userId: string, subscriptionId: string, - newData: UpdateSubscriptionInput + newData: UpdateSubscriptionData ): Promise => { ensureOwns(userId, subscriptionId)