Fix: チャンネルとコミュニティが作成できない問題 / Chg: 左側メニューの選択中の線もアニメーションするように
This commit is contained in:
@@ -13,10 +13,7 @@ export default async function ChannelCreate(fastify: FastifyInstance) {
|
||||
if ("error" in req.token)
|
||||
return res.code(400).send(req.token);
|
||||
|
||||
const result = ChannelRepository.schema.safeParse({
|
||||
...req.body as any,
|
||||
userid: req.token.user.userid,
|
||||
});
|
||||
const result = ChannelRepository.schema.omit({ userid: true }).safeParse(req.body);
|
||||
|
||||
if (!result.success) {
|
||||
return res.code(400).send(InputError(result.error.issues));
|
||||
@@ -25,7 +22,10 @@ export default async function ChannelCreate(fastify: FastifyInstance) {
|
||||
try {
|
||||
const channelRepo = fastify.orm.em.getRepository(ChannelEntity);
|
||||
|
||||
const id = await channelRepo.createChannel(result.data);
|
||||
const id = await channelRepo.createChannel({
|
||||
...result.data,
|
||||
userid: req.token.user.id,
|
||||
});
|
||||
|
||||
return res.send({
|
||||
success: true,
|
||||
|
||||
@@ -13,10 +13,7 @@ export default async function CommunityCreate(fastify: FastifyInstance) {
|
||||
if ("error" in req.token)
|
||||
return res.code(400).send(req.token);
|
||||
|
||||
const result = CommunityRepository.schema.omit({ icon: true }).safeParse({
|
||||
...req.body as any,
|
||||
userid: req.token.user.userid,
|
||||
});
|
||||
const result = CommunityRepository.schema.omit({ userid: true, icon: true }).safeParse(req.body);
|
||||
|
||||
if (!result.success) {
|
||||
return res.code(400).send(InputError(result.error.issues));
|
||||
@@ -25,7 +22,10 @@ export default async function CommunityCreate(fastify: FastifyInstance) {
|
||||
try {
|
||||
const communityRepo = fastify.orm.em.getRepository(CommunityEntity);
|
||||
|
||||
const id = await communityRepo.createCommunity(result.data);
|
||||
const id = await communityRepo.createCommunity({
|
||||
...result.data,
|
||||
userid: req.token.user.id,
|
||||
});
|
||||
|
||||
return res.send({
|
||||
success: true,
|
||||
|
||||
@@ -106,7 +106,7 @@ main.layout {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.left-menu a.isActive::before {
|
||||
.left-menu a::before {
|
||||
content: "";
|
||||
display: block;
|
||||
position: absolute;
|
||||
@@ -116,6 +116,11 @@ main.layout {
|
||||
width: 0.25rem;
|
||||
height: 70%;
|
||||
border-radius: 0.5rem;
|
||||
background-color: transparent;
|
||||
transition: all 200ms ease-out;
|
||||
}
|
||||
|
||||
.left-menu a.isActive::before {
|
||||
background-color: var(--text-color);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user