Fix: 不要なanyの使用
This commit is contained in:
@@ -15,20 +15,13 @@ export default function PrimarySignUp(fastify: FastifyInstance) {
|
|||||||
try {
|
try {
|
||||||
const requiredInvitationCode = await fastify.orm.em.getRepository(ConfigEntity).get("requiredInvitationCode", "true") as string;
|
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({
|
const result = UserRepository.schema.pick({
|
||||||
userid: true,
|
userid: true,
|
||||||
email: true,
|
email: true,
|
||||||
password: true,
|
password: true,
|
||||||
}).merge(reqInvCodeSchema).safeParse(req.body);
|
}).merge(z.object({
|
||||||
|
reqInvCode: z.string().trim().min(1).optional(),
|
||||||
|
})).safeParse(req.body);
|
||||||
|
|
||||||
if (!result.success) {
|
if (!result.success) {
|
||||||
console.log(result.error.issues)
|
console.log(result.error.issues)
|
||||||
@@ -36,7 +29,7 @@ export default function PrimarySignUp(fastify: FastifyInstance) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const error = await fastify.orm.em.getRepository(UserEntity).createUser({
|
const error = await fastify.orm.em.getRepository(UserEntity).createUser({
|
||||||
...(result.data as any),
|
...result.data,
|
||||||
isAdmin: false,
|
isAdmin: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -63,8 +63,9 @@ defineProps<{
|
|||||||
const model = defineModel<string>();
|
const model = defineModel<string>();
|
||||||
const id = useId();
|
const id = useId();
|
||||||
|
|
||||||
const resize = (event: any) => {
|
const resize = (event: Event) => {
|
||||||
event.target.style.height = "auto";
|
const target = event.target as HTMLTextAreaElement;
|
||||||
event.target.style.height = event.target.scrollHeight + 'px';
|
target.style.height = "auto";
|
||||||
|
target.style.height = target.scrollHeight + 'px';
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -183,10 +183,11 @@ const message = ref<string>("");
|
|||||||
|
|
||||||
const isInsideRange = ref(false);
|
const isInsideRange = ref(false);
|
||||||
const isLoading = ref(false);
|
const isLoading = ref(false);
|
||||||
const messagesScroll = async (event: any) => {
|
const messagesScroll = async (event: Event) => {
|
||||||
const handleSize = 200;
|
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) {
|
if (isCurrentInside && !isInsideRange.value && !isLoading.value) {
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
await new Promise<void>(resolve => setTimeout(resolve, 0));
|
await new Promise<void>(resolve => setTimeout(resolve, 0));
|
||||||
@@ -230,9 +231,10 @@ const messagesScroll = async (event: any) => {
|
|||||||
isInsideRange.value = isCurrentInside;
|
isInsideRange.value = isCurrentInside;
|
||||||
}
|
}
|
||||||
|
|
||||||
const resize = (event: any) => {
|
const resize = (event: Event) => {
|
||||||
event.target.style.height = "auto";
|
const target = event.target as HTMLTextAreaElement;
|
||||||
event.target.style.height = event.target.scrollHeight + 'px';
|
target.style.height = "auto";
|
||||||
|
target.style.height = target.scrollHeight + 'px';
|
||||||
}
|
}
|
||||||
|
|
||||||
const send = async (e: Event) => {
|
const send = async (e: Event) => {
|
||||||
|
|||||||
@@ -248,8 +248,9 @@ if (!account.value?.success) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleOutsideClick = (event: any) => {
|
const handleOutsideClick = (event: Event) => {
|
||||||
if (menuElem.value?.menuElem && !menuElem.value.menuElem.contains(event.target)) {
|
const target = event.target as HTMLElement;
|
||||||
|
if (menuElem.value?.menuElem && !menuElem.value.menuElem.contains(target)) {
|
||||||
isMenuOpen.value = false;
|
isMenuOpen.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user