Skip to content

Commit

Permalink
Merge pull request #86 from RnDAO/role-channel-name-changes
Browse files Browse the repository at this point in the history
change role and channel field names
  • Loading branch information
cyri113 authored Jun 29, 2023
2 parents bb14d0c + fc95e7f commit 76460c9
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions __tests__/unit/models/channel.model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ describe('Channel model', () => {
let channel: IChannel;
beforeEach(() => {
channel = {
id: '123',
channelId: '123',
name: 'channel1',
parent_id: 'admin',
parentId: 'admin',
};
});
test('should correctly validate a valid Channel data', async () => {
Expand Down
2 changes: 1 addition & 1 deletion __tests__/unit/models/role.model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('Role model', () => {
let role: IRole;
beforeEach(() => {
role = {
id: '123',
roleId: '123',
name: 'role1',
color: 1234,
};
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@togethercrew.dev/db",
"version": "2.4.4",
"version": "2.4.5",
"description": "All interactions with DB",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down
6 changes: 3 additions & 3 deletions src/interfaces/Channel.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { type Snowflake } from 'discord.js';
import { type Model } from 'mongoose';

export interface IChannel {
id: Snowflake;
channelId: Snowflake;
name?: string | null;
parent_id?: string | null;
parentId?: string | null;
}

export interface IChannelUpdateBody {
name?: string | null;
parent_id?: string | null;
parentId?: string | null;
}

export interface ChannelModel extends Model<IChannel> {
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/Role.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { type Snowflake } from 'discord.js';
import { type Model } from 'mongoose';

export interface IRole {
id: Snowflake;
roleId: Snowflake;
name: string;
color: number;
}
Expand Down
4 changes: 2 additions & 2 deletions src/models/schemas/Channel.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { toJSON } from './plugins';
import { IChannel, ChannelModel } from '../../interfaces';

const channelSchema = new Schema<IChannel, ChannelModel>({
id: {
channelId: {
type: String,
unique: true,
},
name: {
type: String,
},
parent_id: {
parentId: {
type: String,
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/models/schemas/Role.schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { toJSON } from './plugins';
import { IRole, RoleModel } from '../../interfaces';

const roleSchema = new Schema<IRole, RoleModel>({
id: {
roleId: {
type: String,
unique: true,
},
Expand Down

0 comments on commit 76460c9

Please sign in to comment.