mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
refactor(api): 🏷️ Port all /api/v1/accounts to use new schemas
Some checks failed
Mirror to Codeberg / Mirror (push) Failing after 0s
Some checks failed
Mirror to Codeberg / Mirror (push) Failing after 0s
This commit is contained in:
parent
a0ce18337a
commit
e3e285571e
44 changed files with 840 additions and 475 deletions
|
|
@ -231,7 +231,7 @@ export const parseTextMentions = async (
|
|||
return [];
|
||||
}
|
||||
|
||||
const baseUrlHost = new URL(config.http.base_url).host;
|
||||
const baseUrlHost = config.http.base_url.host;
|
||||
const isLocal = (host?: string): boolean => host === baseUrlHost || !host;
|
||||
|
||||
// Find local and matching users
|
||||
|
|
@ -301,7 +301,7 @@ export const replaceTextMentions = (text: string, mentions: User[]): string => {
|
|||
return mentions.reduce((finalText, mention) => {
|
||||
const { username, instance } = mention.data;
|
||||
const uri = mention.getUri();
|
||||
const baseHost = new URL(config.http.base_url).host;
|
||||
const baseHost = config.http.base_url.host;
|
||||
const linkTemplate = (displayText: string): string =>
|
||||
`<a class="u-url mention" rel="nofollow noopener noreferrer" target="_blank" href="${uri}">${displayText}</a>`;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue