Skip to content

Commit

Permalink
Refactor Generate Invite
Browse files Browse the repository at this point in the history
  • Loading branch information
theADAMJR committed Aug 11, 2021
1 parent ef95e75 commit ed10c88
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/src/data/models/invite.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { model, Schema } from 'mongoose';
import { generateInvite } from '../../utils/invite';
import generateInvite from '../../utils/generate-invite';
import { useId } from '../data-utils';

export interface InviteDocument extends Entity.Invite, Document {}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { v4 } from 'uuid';

// TODO: make better file name
export function generateInvite(length = 6) {
export default function (length = 6) {
return v4()
.replace(/-/g, '')
.slice(0, length);
Expand Down
2 changes: 1 addition & 1 deletion backend/src/ws/events/user-delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { WSEvent } from './ws-event';
import { Socket } from 'socket.io';
import { WS } from '../websocket';
import { User } from '../../data/models/user';
import { generateInvite } from '../../utils/invite';
import generateInvite from '../../utils/generate-invite';

export default class implements WSEvent<'USER_DELETE'> {
public on = 'USER_DELETE' as const;
Expand Down

0 comments on commit ed10c88

Please sign in to comment.