Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
canifa_note
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vũ Hoàng Anh
canifa_note
Commits
1ced0bcd
Commit
1ced0bcd
authored
Oct 31, 2025
by
Steven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: fix linter
parent
bc1550e9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
activity_service.go
server/router/api/v1/activity_service.go
+2
-2
user_service.go
server/router/api/v1/user_service.go
+4
-2
No files found.
server/router/api/v1/activity_service.go
View file @
1ced0bcd
server/router/api/v1/user_service.go
View file @
1ced0bcd
...
@@ -1645,6 +1645,8 @@ func (s *APIV1Service) UpdateUserNotification(ctx context.Context, request *v1pb
...
@@ -1645,6 +1645,8 @@ func (s *APIV1Service) UpdateUserNotification(ctx context.Context, request *v1pb
return
nil
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"invalid status"
)
return
nil
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"invalid status"
)
}
}
update
.
Status
=
inboxStatus
update
.
Status
=
inboxStatus
default
:
return
nil
,
status
.
Errorf
(
codes
.
InvalidArgument
,
"invalid update path: %s"
,
path
)
}
}
}
}
...
@@ -1700,7 +1702,7 @@ func (s *APIV1Service) DeleteUserNotification(ctx context.Context, request *v1pb
...
@@ -1700,7 +1702,7 @@ func (s *APIV1Service) DeleteUserNotification(ctx context.Context, request *v1pb
// convertInboxToUserNotification converts a storage-layer inbox to an API notification.
// convertInboxToUserNotification converts a storage-layer inbox to an API notification.
// This handles the mapping between the internal inbox representation and the public API.
// This handles the mapping between the internal inbox representation and the public API.
func
(
s
*
APIV1Service
)
convertInboxToUserNotification
(
ctx
context
.
Context
,
inbox
*
store
.
Inbox
)
(
*
v1pb
.
UserNotification
,
error
)
{
func
(
*
APIV1Service
)
convertInboxToUserNotification
(
_
context
.
Context
,
inbox
*
store
.
Inbox
)
(
*
v1pb
.
UserNotification
,
error
)
{
notification
:=
&
v1pb
.
UserNotification
{
notification
:=
&
v1pb
.
UserNotification
{
Name
:
fmt
.
Sprintf
(
"users/%d/notifications/%d"
,
inbox
.
ReceiverID
,
inbox
.
ID
),
Name
:
fmt
.
Sprintf
(
"users/%d/notifications/%d"
,
inbox
.
ReceiverID
,
inbox
.
ID
),
Sender
:
fmt
.
Sprintf
(
"%s%d"
,
UserNamePrefix
,
inbox
.
SenderID
),
Sender
:
fmt
.
Sprintf
(
"%s%d"
,
UserNamePrefix
,
inbox
.
SenderID
),
...
@@ -1735,7 +1737,7 @@ func (s *APIV1Service) convertInboxToUserNotification(ctx context.Context, inbox
...
@@ -1735,7 +1737,7 @@ func (s *APIV1Service) convertInboxToUserNotification(ctx context.Context, inbox
}
}
// ExtractNotificationIDFromName extracts the notification ID from a resource name.
// ExtractNotificationIDFromName extracts the notification ID from a resource name.
// Expected format: users/{user_id}/notifications/{notification_id}
// Expected format: users/{user_id}/notifications/{notification_id}
.
func
ExtractNotificationIDFromName
(
name
string
)
(
int32
,
error
)
{
func
ExtractNotificationIDFromName
(
name
string
)
(
int32
,
error
)
{
pattern
:=
regexp
.
MustCompile
(
`^users/(\d+)/notifications/(\d+)$`
)
pattern
:=
regexp
.
MustCompile
(
`^users/(\d+)/notifications/(\d+)$`
)
matches
:=
pattern
.
FindStringSubmatch
(
name
)
matches
:=
pattern
.
FindStringSubmatch
(
name
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment