use user provided url for feed added
This commit is contained in:
@ -193,15 +193,8 @@ export const subscribeResolver = authorized<
|
||||
env: env.server.apiEnv,
|
||||
},
|
||||
})
|
||||
|
||||
// validate rss feed
|
||||
const feed = await parseFeed(input.url)
|
||||
if (!feed) {
|
||||
return {
|
||||
errorCodes: [SubscribeErrorCode.NotFound],
|
||||
}
|
||||
}
|
||||
const feedUrl = feed.url
|
||||
// use user provided url
|
||||
const feedUrl = input.url
|
||||
try {
|
||||
validateUrl(feedUrl)
|
||||
} catch (error) {
|
||||
@ -212,6 +205,14 @@ export const subscribeResolver = authorized<
|
||||
}
|
||||
}
|
||||
|
||||
// validate rss feed
|
||||
const feed = await parseFeed(feedUrl)
|
||||
if (!feed) {
|
||||
return {
|
||||
errorCodes: [SubscribeErrorCode.NotFound],
|
||||
}
|
||||
}
|
||||
|
||||
// find existing subscription
|
||||
const existingSubscription = await getRepository(Subscription).findOneBy({
|
||||
url: In([feedUrl, input.url]), // check both user provided url and parsed url
|
||||
|
||||
Reference in New Issue
Block a user