delete birthday param on users/following api
This commit is contained in:
parent
d3d69ae5ab
commit
a47456c1c4
|
|
@ -66,11 +66,6 @@ export const paramDef = {
|
||||||
nullable: true,
|
nullable: true,
|
||||||
description: 'The local host is represented with `null`.',
|
description: 'The local host is represented with `null`.',
|
||||||
},
|
},
|
||||||
|
|
||||||
birthday: {
|
|
||||||
...birthdaySchema, nullable: true,
|
|
||||||
description: '@deprecated use get-following-birthday-users instead.',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
anyOf: [
|
anyOf: [
|
||||||
{ required: ['userId'] },
|
{ required: ['userId'] },
|
||||||
|
|
@ -129,20 +124,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
.andWhere('following.followerId = :userId', { userId: user.id })
|
.andWhere('following.followerId = :userId', { userId: user.id })
|
||||||
.innerJoinAndSelect('following.followee', 'followee');
|
.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
|
const followings = await query
|
||||||
.limit(ps.limit)
|
.limit(ps.limit)
|
||||||
.getMany();
|
.getMany();
|
||||||
|
|
|
||||||
|
|
@ -24430,8 +24430,6 @@ export type operations = {
|
||||||
username?: string;
|
username?: string;
|
||||||
/** @description The local host is represented with `null`. */
|
/** @description The local host is represented with `null`. */
|
||||||
host?: string | null;
|
host?: string | null;
|
||||||
/** @description @deprecated use get-following-birthday-users instead. */
|
|
||||||
birthday?: string | null;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue