mirror of
https://github.com/versia-pub/server.git
synced 2025-12-07 00:48:18 +01:00
fix(api): 🐛 Give correct URI/URL values for notes in API
This commit is contained in:
parent
c6c71bebb7
commit
11369649c0
|
|
@ -723,7 +723,7 @@ export class Note {
|
||||||
sensitive: data.sensitive,
|
sensitive: data.sensitive,
|
||||||
spoiler_text: data.spoilerText,
|
spoiler_text: data.spoilerText,
|
||||||
tags: [],
|
tags: [],
|
||||||
uri: data.uri || this.getMastoURI(),
|
uri: data.uri || this.getURI(),
|
||||||
visibility: data.visibility as APIStatus["visibility"],
|
visibility: data.visibility as APIStatus["visibility"],
|
||||||
url: data.uri || this.getMastoURI(),
|
url: data.uri || this.getMastoURI(),
|
||||||
bookmarked: false,
|
bookmarked: false,
|
||||||
|
|
@ -747,7 +747,10 @@ export class Note {
|
||||||
}
|
}
|
||||||
|
|
||||||
getMastoURI() {
|
getMastoURI() {
|
||||||
return `/@${this.getAuthor().getUser().username}/${this.id}`;
|
return new URL(
|
||||||
|
`/@${this.getAuthor().getUser().username}/${this.id}`,
|
||||||
|
config.http.base_url,
|
||||||
|
).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
toLysand(): typeof EntityValidator.$Note {
|
toLysand(): typeof EntityValidator.$Note {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue