delete birthday param on users/following api

This commit is contained in:
kakkokari-gtyih 2024-03-30 16:01:57 +09:00
parent d3d69ae5ab
commit a47456c1c4
2 changed files with 0 additions and 21 deletions

View File

@ -66,11 +66,6 @@ export const paramDef = {
nullable: true,
description: 'The local host is represented with `null`.',
},
birthday: {
...birthdaySchema, nullable: true,
description: '@deprecated use get-following-birthday-users instead.',
},
},
anyOf: [
{ required: ['userId'] },
@ -129,20 +124,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
.andWhere('following.followerId = :userId', { userId: user.id })
.innerJoinAndSelect('following.followee', 'followee');
// @deprecated use get-following-birthday-users instead.
if (ps.birthday) {
query.innerJoin(this.userProfilesRepository.metadata.targetName, 'followeeProfile', 'followeeProfile.userId = following.followeeId');
try {
const birthday = ps.birthday.split('-');
birthday.shift(); // 年の部分を削除
// なぜか get_birthday_date() = :birthday だとインデックスが効かないので、BETWEEN で対応
query.andWhere('get_birthday_date(followeeProfile.birthday) BETWEEN :birthday AND :birthday', { birthday: parseInt(birthday.join('')) });
} catch (err) {
throw new ApiError(meta.errors.birthdayInvalid);
}
}
const followings = await query
.limit(ps.limit)
.getMany();

View File

@ -24430,8 +24430,6 @@ export type operations = {
username?: string;
/** @description The local host is represented with `null`. */
host?: string | null;
/** @description @deprecated use get-following-birthday-users instead. */
birthday?: string | null;
};
};
};