mirror of
https://github.com/misskey-dev/misskey.git
synced 2024-12-28 16:38:23 +01:00
refactor
This commit is contained in:
parent
18380f8e01
commit
8f04bacef3
1 changed files with 7 additions and 7 deletions
|
@ -54,20 +54,20 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
return await this.perUserFollowingChart.getChart(ps.span, ps.limit, ps.offset ? new Date(ps.offset) : null, ps.userId);
|
return await this.perUserFollowingChart.getChart(ps.span, ps.limit, ps.offset ? new Date(ps.offset) : null, ps.userId);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (me != null && me.id === ps.userId) {
|
||||||
|
return await done();
|
||||||
|
}
|
||||||
|
|
||||||
const profile = await this.userProfilesRepository.findOneByOrFail({ userId: ps.userId });
|
const profile = await this.userProfilesRepository.findOneByOrFail({ userId: ps.userId });
|
||||||
|
|
||||||
if (profile.followingVisibility === 'public' && profile.followersVisibility === 'public') {
|
if (profile.followingVisibility === 'public' && profile.followersVisibility === 'public') {
|
||||||
done();
|
return await done();
|
||||||
}
|
|
||||||
|
|
||||||
if (me != null && me.id === ps.userId) {
|
|
||||||
done();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const iAmModerator = await this.roleService.isModerator(me);
|
const iAmModerator = await this.roleService.isModerator(me);
|
||||||
|
|
||||||
if (iAmModerator) {
|
if (iAmModerator) {
|
||||||
done();
|
return await done();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
|
@ -79,7 +79,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
) {
|
) {
|
||||||
const relations = await this.userEntityService.getRelation(me.id, ps.userId);
|
const relations = await this.userEntityService.getRelation(me.id, ps.userId);
|
||||||
if (relations.following) {
|
if (relations.following) {
|
||||||
done();
|
return await done();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue