mirror of https://github.com/usememos/memos.git
fix: restore webhook setting conversion formatting
This commit is contained in:
parent
9cd4a79e49
commit
beb0232a25
|
|
@ -77,15 +77,6 @@ func ExtractUserIDFromName(name string) (int32, error) {
|
|||
return id, nil
|
||||
}
|
||||
|
||||
// extractUserIdentifierFromName extracts the username token from a user resource name.
|
||||
func extractUserIdentifierFromName(name string) string {
|
||||
username, err := ExtractUsernameFromName(name)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
return username
|
||||
}
|
||||
|
||||
// ExtractMemoUIDFromName returns the memo UID from a resource name.
|
||||
// e.g., "memos/uuid" -> "uuid".
|
||||
func ExtractMemoUIDFromName(name string) (string, error) {
|
||||
|
|
|
|||
|
|
@ -1084,13 +1084,13 @@ func convertUserSettingFromStore(storeSetting *storepb.UserSetting, user *store.
|
|||
}
|
||||
case storepb.UserSetting_WEBHOOKS:
|
||||
webhooks := storeSetting.GetWebhooks()
|
||||
apiWebhooks := make([]*v1pb.UserWebhook, 0, len(webhooks.Webhooks))
|
||||
for _, webhook := range webhooks.Webhooks {
|
||||
apiWebhook := &v1pb.UserWebhook{
|
||||
Name: fmt.Sprintf("%s/webhooks/%s", BuildUserName(user.Username), webhook.Id),
|
||||
Url: webhook.Url,
|
||||
DisplayName: webhook.Title,
|
||||
}
|
||||
apiWebhooks := make([]*v1pb.UserWebhook, 0, len(webhooks.Webhooks))
|
||||
for _, webhook := range webhooks.Webhooks {
|
||||
apiWebhook := &v1pb.UserWebhook{
|
||||
Name: fmt.Sprintf("%s/webhooks/%s", BuildUserName(user.Username), webhook.Id),
|
||||
Url: webhook.Url,
|
||||
DisplayName: webhook.Title,
|
||||
}
|
||||
apiWebhooks = append(apiWebhooks, apiWebhook)
|
||||
}
|
||||
setting.Value = &v1pb.UserSetting_WebhooksSetting_{
|
||||
|
|
|
|||
Loading…
Reference in New Issue