Skip to content

Commit f03497a

Browse files
authored
Merge pull request #152 from TogetherCrew/Add-type-to-channel
Add type to channel
2 parents 4fe57d1 + 3179f1a commit f03497a

File tree

6 files changed

+11
-4
lines changed

6 files changed

+11
-4
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ Channel {
118118
name?: string | null,
119119
parent_id?: string | null,
120120
permissionOverwrites?: IOverwrite[],
121-
deletedAt?: Date | null
121+
deletedAt?: Date | null,
122+
type: number
122123
}
123124
```
124125

__tests__/unit/models/channel.model.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ describe('Channel model', () => {
99
channelId: '123',
1010
name: 'channel1',
1111
parentId: 'admin',
12+
type: 1,
1213
permissionOverwrites: [
1314
{
1415
id: '1122334455', // example Snowflake ID for the role or member

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@togethercrew.dev/db",
3-
"version": "3.0.31",
3+
"version": "3.0.32",
44
"description": "All interactions with DB",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

src/interfaces/Channel.interface.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ export interface IChannel {
1414
parentId?: string | null;
1515
permissionOverwrites?: IOverwrite[];
1616
deletedAt?: Date | null;
17+
type: number;
1718
}
1819

1920
export interface IChannelUpdateBody {
2021
name?: string | null;
2122
parentId?: string | null;
2223
permissionOverwrites?: IOverwrite[];
2324
deletedAt?: Date | null;
25+
type?: number;
2426
}
2527
export interface IChannelMethods {
2628
softDelete: () => void;

src/models/schemas/Channel.schema.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ const channelSchema = new Schema<IChannel, ChannelModel>({
1313
parentId: {
1414
type: String,
1515
},
16+
type: {
17+
type: Number,
18+
},
1619
permissionOverwrites: [
1720
{
1821
id: String, // or use mongoose.Schema.Types.ObjectId if Snowflake is an ObjectId

0 commit comments

Comments
 (0)