diff options
author | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-03-22 21:52:56 +0100 |
---|---|---|
committer | Flam3rboy <34555296+Flam3rboy@users.noreply.github.com> | 2021-03-22 21:52:56 +0100 |
commit | b346ff857d91d6e7665756631fe03100c3e0972d (patch) | |
tree | 55c7d3a4d97db8954f735ffa4e29d21569346bf9 /src/routes | |
parent | :construction: [Route] /messages (diff) | |
download | server-b346ff857d91d6e7665756631fe03100c3e0972d.tar.xz |
:construction: shorten relative paths with @shortcut
Diffstat (limited to 'src/routes')
4 files changed, 18 insertions, 18 deletions
diff --git a/src/routes/api/v8/channels/#channel_id/invites.ts b/src/routes/api/v8/channels/#channel_id/invites.ts index 0e09c00c..e3f2b77e 100644 --- a/src/routes/api/v8/channels/#channel_id/invites.ts +++ b/src/routes/api/v8/channels/#channel_id/invites.ts @@ -1,11 +1,11 @@ import { Router, Request, Response } from "express"; import { HTTPError } from "lambert-server"; -import { check } from "../../../../../util/instanceOf"; -import { random } from "../../../../../util/RandomInviteID"; -import { emitEvent } from "../../../../../util/Event"; +import { check } from "@util/instanceOf"; +import { random } from "@util/RandomInviteID"; +import { emitEvent } from "@util/Event"; -import { InviteCreateSchema } from "../../../../../schema/Invite"; +import { InviteCreateSchema } from "@schema/Invite"; import { getPermission, ChannelModel, InviteModel, InviteCreateEvent } from "fosscord-server-util"; diff --git a/src/routes/api/v8/channels/#channel_id/messages/bulk-delete.ts b/src/routes/api/v8/channels/#channel_id/messages/bulk-delete.ts index c805cf08..dc7d5f66 100644 --- a/src/routes/api/v8/channels/#channel_id/messages/bulk-delete.ts +++ b/src/routes/api/v8/channels/#channel_id/messages/bulk-delete.ts @@ -1,9 +1,9 @@ import { Router } from "express"; import { ChannelModel, getPermission, MessageDeleteBulkEvent, MessageModel } from "fosscord-server-util"; import { HTTPError } from "lambert-server"; -import Config from "../../../../../../util/Config"; -import { emitEvent } from "../../../../../../util/Event"; -import { check } from "../../../../../../util/instanceOf"; +import Config from "@util/Config"; +import { emitEvent } from "@util/Event"; +import { check } from "@util/instanceOf"; const router: Router = Router(); diff --git a/src/routes/api/v8/channels/#channel_id/messages/index.ts b/src/routes/api/v8/channels/#channel_id/messages/index.ts index 87427257..2f383056 100644 --- a/src/routes/api/v8/channels/#channel_id/messages/index.ts +++ b/src/routes/api/v8/channels/#channel_id/messages/index.ts @@ -1,11 +1,11 @@ import { Router } from "express"; import { ChannelModel, ChannelType, getPermission, Message, MessageCreateEvent, MessageModel, Snowflake } from "fosscord-server-util"; import { HTTPError } from "lambert-server"; -import { MessageCreateSchema } from "../../../../../../schema/Message"; -import { check, instanceOf, Length } from "../../../../../../util/instanceOf"; -import { PublicUserProjection } from "../../../../../../util/User"; +import { MessageCreateSchema } from "@schema/Message"; +import { check, instanceOf, Length } from "@util/instanceOf"; +import { PublicUserProjection } from "@util/User"; import multer from "multer"; -import { emitEvent } from "../../../../../../util/Event"; +import { emitEvent } from "@util/Event"; const router: Router = Router(); export default router; @@ -120,7 +120,7 @@ router.post("/", check(MessageCreateSchema), async (req, res) => { timestamp: new Date(), }; - await new MessageModel().save(); + await new MessageModel(message).save(); await emitEvent({ event: "MESSAGE_CREATE", channel_id, data: {} } as MessageCreateEvent); }); diff --git a/src/routes/api/v8/guilds/#id/bans.ts b/src/routes/api/v8/guilds/#id/bans.ts index 5133ee3c..9fbcf01c 100644 --- a/src/routes/api/v8/guilds/#id/bans.ts +++ b/src/routes/api/v8/guilds/#id/bans.ts @@ -1,12 +1,12 @@ import { Request, Response, Router } from "express"; import { BanModel, getPermission, GuildBanAddEvent, GuildBanRemoveEvent, GuildModel } from "fosscord-server-util"; import { HTTPError } from "lambert-server"; -import { getIpAdress } from "../../../../../middlewares/GlobalRateLimit"; -import { BanCreateSchema } from "../../../../../schema/Ban"; -import { emitEvent } from "../../../../../util/Event"; -import { check } from "../../../../../util/instanceOf"; -import { removeMember } from "../../../../../util/Member"; -import { getPublicUser } from "../../../../../util/User"; +import { getIpAdress } from "@middlewares/GlobalRateLimit"; +import { BanCreateSchema } from "@schema/Ban"; +import { emitEvent } from "@util/Event"; +import { check } from "@util/instanceOf"; +import { removeMember } from "@util/Member"; +import { getPublicUser } from "@util/User"; const router: Router = Router(); |