rename fkt name

This commit is contained in:
Michael Jerger 2024-05-17 08:15:51 +02:00
parent 8b90194d1b
commit 5ce359b14e
2 changed files with 5 additions and 5 deletions

View file

@ -307,8 +307,8 @@ func (u *User) HTMLURL() string {
return setting.AppURL + url.PathEscape(u.Name) return setting.AppURL + url.PathEscape(u.Name)
} }
// APAPIURL returns the IRI to the api endpoint of the user // APActorID returns the IRI to the api endpoint of the user
func (u *User) APAPIURL() string { func (u *User) APActorID() string {
return fmt.Sprintf("%vapi/v1/activitypub/user-id/%v", setting.AppURL, url.PathEscape(fmt.Sprintf("%v", u.ID))) return fmt.Sprintf("%vapi/v1/activitypub/user-id/%v", setting.AppURL, url.PathEscape(fmt.Sprintf("%v", u.ID)))
} }

View file

@ -108,12 +108,12 @@ func TestGetAllUsers(t *testing.T) {
assert.False(t, found[user_model.UserTypeOrganization], users) assert.False(t, found[user_model.UserTypeOrganization], users)
} }
func TestAPAPIURL(t *testing.T) { func TestAPActorID(t *testing.T) {
user := user_model.User{ID: 1} user := user_model.User{ID: 1}
url := user.APAPIURL() url := user.APActorID()
expected := "https://try.gitea.io/api/v1/activitypub/user-id/1" expected := "https://try.gitea.io/api/v1/activitypub/user-id/1"
if url != expected { if url != expected {
t.Errorf("unexpected APAPIURL, expected: %q, actual: %q", expected, url) t.Errorf("unexpected APActorID, expected: %q, actual: %q", expected, url)
} }
} }