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