Fix: 不要なanyの使用

This commit is contained in:
2026-06-06 12:41:45 +09:00
parent 37ce1aed50
commit 3cb63f08f2
4 changed files with 18 additions and 21 deletions
+4 -11
View File
@@ -15,20 +15,13 @@ export default function PrimarySignUp(fastify: FastifyInstance) {
try {
const requiredInvitationCode = await fastify.orm.em.getRepository(ConfigEntity).get("requiredInvitationCode", "true") as string;
let reqInvCodeSchema: ZodObject<any>;
if (requiredInvitationCode !== "true") {
reqInvCodeSchema = z.object({});
} else {
reqInvCodeSchema = z.object({
invitationCode: z.string().trim().min(1),
});
}
const result = UserRepository.schema.pick({
userid: true,
email: true,
password: true,
}).merge(reqInvCodeSchema).safeParse(req.body);
}).merge(z.object({
reqInvCode: z.string().trim().min(1).optional(),
})).safeParse(req.body);
if (!result.success) {
console.log(result.error.issues)
@@ -36,7 +29,7 @@ export default function PrimarySignUp(fastify: FastifyInstance) {
}
const error = await fastify.orm.em.getRepository(UserEntity).createUser({
...(result.data as any),
...result.data,
isAdmin: false,
});
@@ -63,8 +63,9 @@ defineProps<{
const model = defineModel<string>();
const id = useId();
const resize = (event: any) => {
event.target.style.height = "auto";
event.target.style.height = event.target.scrollHeight + 'px';
const resize = (event: Event) => {
const target = event.target as HTMLTextAreaElement;
target.style.height = "auto";
target.style.height = target.scrollHeight + 'px';
}
</script>
@@ -183,10 +183,11 @@ const message = ref<string>("");
const isInsideRange = ref(false);
const isLoading = ref(false);
const messagesScroll = async (event: any) => {
const messagesScroll = async (event: Event) => {
const handleSize = 200;
const isCurrentInside = event.target.scrollTop < handleSize;
const target = event.target as HTMLDivElement;
const isCurrentInside = target.scrollTop < handleSize;
if (isCurrentInside && !isInsideRange.value && !isLoading.value) {
isLoading.value = true;
await new Promise<void>(resolve => setTimeout(resolve, 0));
@@ -230,9 +231,10 @@ const messagesScroll = async (event: any) => {
isInsideRange.value = isCurrentInside;
}
const resize = (event: any) => {
event.target.style.height = "auto";
event.target.style.height = event.target.scrollHeight + 'px';
const resize = (event: Event) => {
const target = event.target as HTMLTextAreaElement;
target.style.height = "auto";
target.style.height = target.scrollHeight + 'px';
}
const send = async (e: Event) => {
@@ -248,8 +248,9 @@ if (!account.value?.success) {
}
}
const handleOutsideClick = (event: any) => {
if (menuElem.value?.menuElem && !menuElem.value.menuElem.contains(event.target)) {
const handleOutsideClick = (event: Event) => {
const target = event.target as HTMLElement;
if (menuElem.value?.menuElem && !menuElem.value.menuElem.contains(target)) {
isMenuOpen.value = false;
}
}