mirror of
https://github.com/versia-pub/server.git
synced 2026-04-27 20:59:15 +02:00
refactor(database): Remove unused columns and rename baseUrl to domain
This commit is contained in:
parent
35d285bb2a
commit
df2a5ce260
16 changed files with 2448 additions and 59 deletions
|
|
@ -39,7 +39,7 @@ export const parseMentionsFromText = async (text: string): Promise<User[]> => {
|
|||
.select({
|
||||
id: Users.id,
|
||||
username: Users.username,
|
||||
baseUrl: Instances.baseUrl,
|
||||
baseUrl: Instances.domain,
|
||||
})
|
||||
.from(Users)
|
||||
.leftJoin(Instances, eq(Users.instanceId, Instances.id))
|
||||
|
|
@ -50,7 +50,7 @@ export const parseMentionsFromText = async (text: string): Promise<User[]> => {
|
|||
eq(Users.username, person[1] ?? ""),
|
||||
isLocal(person[2])
|
||||
? isNull(Users.instanceId)
|
||||
: eq(Instances.baseUrl, person[2] ?? ""),
|
||||
: eq(Instances.domain, person[2] ?? ""),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
@ -110,8 +110,8 @@ export const linkifyUserMentions = (text: string, mentions: User[]): string => {
|
|||
|
||||
if (mention.remote) {
|
||||
return finalText.replaceAll(
|
||||
`@${username}@${instance?.baseUrl}`,
|
||||
linkTemplate(`@${username}@${instance?.baseUrl}`),
|
||||
`@${username}@${instance?.domain}`,
|
||||
linkTemplate(`@${username}@${instance?.domain}`),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue