Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
Rosekey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
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
freelynetwork
Rosekey
Commits
cac1c2f1
Commit
cac1c2f1
authored
1 year ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
fix(backend): notes/reactionsのページネーションが機能しない
parent
ad8ddbf1
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
+1
-0
1 addition, 0 deletions
CHANGELOG.md
packages/backend/src/server/api/endpoints/notes/reactions.ts
+9
-15
9 additions, 15 deletions
packages/backend/src/server/api/endpoints/notes/reactions.ts
with
10 additions
and
15 deletions
CHANGELOG.md
+
1
−
0
View file @
cac1c2f1
...
...
@@ -89,6 +89,7 @@
-
Enhance: 自分へのメンション一覧を取得する際のパフォーマンスを向上
-
Enhance: Docker環境でjemallocを使用することでメモリ使用量を削減
-
Fix: MK_ONLY_SERVERオプションを指定した際にクラッシュする問題を修正
-
Fix: notes/reactionsのページネーションが機能しない問題を修正
-
Fix: ノート検索
`notes/search`
にてhostを指定した際に検索結果に反映されるように
-
Fix: 一部のfeatured noteを照会できない問題を修正
-
Fix: muteがapiからのuser list timeline取得で機能しない問題を修正
...
...
This diff is collapsed.
Click to expand it.
packages/backend/src/server/api/endpoints/notes/reactions.ts
+
9
−
15
View file @
cac1c2f1
...
...
@@ -4,12 +4,13 @@
*/
import
{
Inject
,
Injectable
}
from
'
@nestjs/common
'
;
import
{
Brackets
,
type
FindOptionsWhere
}
from
'
typeorm
'
;
import
type
{
NoteReactionsRepository
}
from
'
@/models/_.js
'
;
import
type
{
MiNoteReaction
}
from
'
@/models/NoteReaction.js
'
;
import
{
Endpoint
}
from
'
@/server/api/endpoint-base.js
'
;
import
{
NoteReactionEntityService
}
from
'
@/core/entities/NoteReactionEntityService.js
'
;
import
{
DI
}
from
'
@/di-symbols.js
'
;
import
type
{
FindOptionsWhere
}
from
'
typeorm
'
;
import
{
QueryService
}
from
'
@/core/QueryService.js
'
;
export
const
meta
=
{
tags
:
[
'
notes
'
,
'
reactions
'
],
...
...
@@ -44,7 +45,6 @@ export const paramDef = {
noteId
:
{
type
:
'
string
'
,
format
:
'
misskey:id
'
},
type
:
{
type
:
'
string
'
,
nullable
:
true
},
limit
:
{
type
:
'
integer
'
,
minimum
:
1
,
maximum
:
100
,
default
:
10
},
offset
:
{
type
:
'
integer
'
,
default
:
0
},
sinceId
:
{
type
:
'
string
'
,
format
:
'
misskey:id
'
},
untilId
:
{
type
:
'
string
'
,
format
:
'
misskey:id
'
},
},
...
...
@@ -58,29 +58,23 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private
noteReactionsRepository
:
NoteReactionsRepository
,
private
noteReactionEntityService
:
NoteReactionEntityService
,
private
queryService
:
QueryService
,
)
{
super
(
meta
,
paramDef
,
async
(
ps
,
me
)
=>
{
const
query
=
{
noteId
:
ps
.
noteId
,
}
as
FindOptionsWhere
<
MiNoteReaction
>
;
const
query
=
this
.
queryService
.
makePaginationQuery
(
this
.
noteReactionsRepository
.
createQueryBuilder
(
'
reaction
'
),
ps
.
sinceId
,
ps
.
untilId
)
.
andWhere
(
'
reaction.noteId = :noteId
'
,
{
noteId
:
ps
.
noteId
})
.
leftJoinAndSelect
(
'
reaction.user
'
,
'
user
'
)
.
leftJoinAndSelect
(
'
reaction.note
'
,
'
note
'
);
if
(
ps
.
type
)
{
// ローカルリアクションはホスト名が . とされているが
// DB 上ではそうではないので、必要に応じて変換
const
suffix
=
'
@.:
'
;
const
type
=
ps
.
type
.
endsWith
(
suffix
)
?
ps
.
type
.
slice
(
0
,
ps
.
type
.
length
-
suffix
.
length
)
+
'
:
'
:
ps
.
type
;
query
.
reaction
=
type
;
query
.
andWhere
(
'
reaction.
reaction =
:
type
'
,
{
type
})
;
}
const
reactions
=
await
this
.
noteReactionsRepository
.
find
({
where
:
query
,
take
:
ps
.
limit
,
skip
:
ps
.
offset
,
order
:
{
id
:
-
1
,
},
relations
:
[
'
user
'
,
'
note
'
],
});
const
reactions
=
await
query
.
limit
(
ps
.
limit
).
getMany
();
return
await
Promise
.
all
(
reactions
.
map
(
reaction
=>
this
.
noteReactionEntityService
.
pack
(
reaction
,
me
)));
});
...
...
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