Revert originalArticleUrl change

This commit is contained in:
Hongbo Wu
2022-05-12 10:45:13 +08:00
parent 412d7cebc6
commit 5dca02873d
2 changed files with 1 additions and 6 deletions

View File

@ -45,7 +45,6 @@ import {
import { ContentParseError } from '../../utils/errors' import { ContentParseError } from '../../utils/errors'
import { import {
authorized, authorized,
cleanDomainInUrl,
generateSlug, generateSlug,
isParsingTimeout, isParsingTimeout,
pageError, pageError,
@ -878,7 +877,7 @@ export const searchResolver = authorized<
isArchived: !!r.archivedAt, isArchived: !!r.archivedAt,
contentReader: contentReader:
r.pageType === PageType.File ? ContentReader.Pdf : ContentReader.Web, r.pageType === PageType.File ? ContentReader.Pdf : ContentReader.Web,
originalArticleUrl: cleanDomainInUrl(r.url), originalArticleUrl: r.url,
publishedAt: validatedDate(r.publishedAt), publishedAt: validatedDate(r.publishedAt),
ownedByViewer: r.userId === claims.uid, ownedByViewer: r.userId === claims.uid,
pageType: r.pageType || PageType.Highlights, pageType: r.pageType || PageType.Highlights,

View File

@ -230,7 +230,3 @@ export const validatedDate = (
return undefined return undefined
} }
} }
export const cleanDomainInUrl = (url: string): string => {
return url.replace(/^((https?:\/\/)?)(www.)/, (match, p1: string) => p1)
}