Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dima Krasner
Sharkey
Commits
1b014bc3
Commit
1b014bc3
authored
2 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
fix(server): 他人の通知を既読にできる可能性があるのを修正
parent
a9e13693
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+3
-0
3 additions, 0 deletions
CHANGELOG.md
packages/backend/src/server/api/common/read-notification.ts
+4
-3
4 additions, 3 deletions
packages/backend/src/server/api/common/read-notification.ts
with
7 additions
and
3 deletions
CHANGELOG.md
+
3
−
0
View file @
1b014bc3
...
...
@@ -14,6 +14,9 @@ You should also include the user name that made the change.
### Improvements
-
Client: Add following badge to user preview popup @nvisser
### Bugfixes
-
Server: 他人の通知を既読にできる可能性があるのを修正 @syuilo
## 12.118.1 (2022/08/08)
### Bugfixes
...
...
This diff is collapsed.
Click to expand it.
packages/backend/src/server/api/common/read-notification.ts
+
4
−
3
View file @
1b014bc3
import
{
In
}
from
'
typeorm
'
;
import
{
publishMainStream
}
from
'
@/services/stream.js
'
;
import
{
pushNotification
}
from
'
@/services/push-notification.js
'
;
import
{
User
}
from
'
@/models/entities/user.js
'
;
import
{
Notification
}
from
'
@/models/entities/notification.js
'
;
import
{
Notifications
,
Users
}
from
'
@/models/index.js
'
;
import
{
In
}
from
'
typeorm
'
;
export
async
function
readNotification
(
userId
:
User
[
'
id
'
],
notificationIds
:
Notification
[
'
id
'
][]
notificationIds
:
Notification
[
'
id
'
][]
,
)
{
if
(
notificationIds
.
length
===
0
)
return
;
// Update documents
const
result
=
await
Notifications
.
update
({
notifieeId
:
userId
,
id
:
In
(
notificationIds
),
isRead
:
false
,
},
{
...
...
@@ -27,7 +28,7 @@ export async function readNotification(
export
async
function
readNotificationByQuery
(
userId
:
User
[
'
id
'
],
query
:
Record
<
string
,
any
>
query
:
Record
<
string
,
any
>
,
)
{
const
notificationIds
=
await
Notifications
.
findBy
({
...
query
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment