mirror of
https://github.com/AtHeartEngineering/bandada.git
synced 2026-01-09 20:18:20 -05:00
fix: missing mapEntity on return and remove unnecessary parameter from invite response
This commit is contained in:
@@ -21,6 +21,7 @@ import { InviteResponse } from "../groups/docSchemas"
|
||||
import { CreateInviteDto } from "./dto/create-invite.dto"
|
||||
import { Invite } from "./entities/invite.entity"
|
||||
import { InvitesService } from "./invites.service"
|
||||
import { mapEntity } from "../utils"
|
||||
|
||||
@ApiTags("invites")
|
||||
@Controller("invites")
|
||||
@@ -58,7 +59,7 @@ export class InvitesController {
|
||||
throw new NotImplementedException()
|
||||
}
|
||||
|
||||
return invite
|
||||
return mapEntity(invite)
|
||||
}
|
||||
|
||||
@Get(":code")
|
||||
@@ -69,6 +70,6 @@ export class InvitesController {
|
||||
): Promise<InviteResponse> {
|
||||
const invite = await this.invitesService.getInvite(inviteCode)
|
||||
|
||||
return invite
|
||||
return mapEntity(invite)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,6 +85,10 @@ export class InvitesService {
|
||||
)
|
||||
}
|
||||
|
||||
// Remove unnecessary parameters.
|
||||
delete group.members
|
||||
delete group.oAuthAccounts
|
||||
|
||||
const invite = this.inviteRepository.create({
|
||||
code: this.generateCode(),
|
||||
group
|
||||
|
||||
Reference in New Issue
Block a user