From 5ce359b14e57cbb731a2f5ff13feb16cae5d9be9 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 17 May 2024 08:15:51 +0200 Subject: [PATCH] rename fkt name --- models/user/user.go | 4 ++-- models/user/user_test.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/models/user/user.go b/models/user/user.go index d2ebb46da3..5844189e17 100644 --- a/models/user/user.go +++ b/models/user/user.go @@ -307,8 +307,8 @@ func (u *User) HTMLURL() string { return setting.AppURL + url.PathEscape(u.Name) } -// APAPIURL returns the IRI to the api endpoint of the user -func (u *User) APAPIURL() string { +// APActorID returns the IRI to the api endpoint of the user +func (u *User) APActorID() string { return fmt.Sprintf("%vapi/v1/activitypub/user-id/%v", setting.AppURL, url.PathEscape(fmt.Sprintf("%v", u.ID))) } diff --git a/models/user/user_test.go b/models/user/user_test.go index 9efe9a9ef5..7457256017 100644 --- a/models/user/user_test.go +++ b/models/user/user_test.go @@ -108,12 +108,12 @@ func TestGetAllUsers(t *testing.T) { assert.False(t, found[user_model.UserTypeOrganization], users) } -func TestAPAPIURL(t *testing.T) { +func TestAPActorID(t *testing.T) { user := user_model.User{ID: 1} - url := user.APAPIURL() + url := user.APActorID() expected := "https://try.gitea.io/api/v1/activitypub/user-id/1" if url != expected { - t.Errorf("unexpected APAPIURL, expected: %q, actual: %q", expected, url) + t.Errorf("unexpected APActorID, expected: %q, actual: %q", expected, url) } }