|
|
@@ -1,6 +1,6 @@
|
|
|
import { FastifyInstance, FastifyReply, FastifyRequest } from 'fastify'
|
|
|
import { TgGroupService } from '../services/tg-group.service'
|
|
|
-import { CreateTgGroupBody } from '../dto/tg-group.dto'
|
|
|
+import { CreateTgGroupBody, InviteMembersBody } from '../dto/tg-group.dto'
|
|
|
|
|
|
export class TgGroupController {
|
|
|
private readonly tgGroupService: TgGroupService
|
|
|
@@ -49,4 +49,12 @@ export class TgGroupController {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ async inviteMembers(request: FastifyRequest<{ Body: InviteMembersBody }>, reply: FastifyReply) {
|
|
|
+ const { senderId, chatId, accessHash, members } = request.body
|
|
|
+
|
|
|
+ const result = await this.tgGroupService.inviteMembers(senderId, chatId, accessHash, members)
|
|
|
+
|
|
|
+ return reply.code(result.success ? 200 : 500).send(result)
|
|
|
+ }
|
|
|
}
|