feat(guild): enable CORS and add members listing API

This commit is contained in:
nav
2026-05-14 16:46:30 +00:00
parent fdb661f32b
commit 9ad6ccaa3d
5 changed files with 65 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { GuildMember } from '../entities/guild-member.entity';
@Injectable()
export class MembersService {
constructor(
@InjectRepository(GuildMember)
private readonly memberRepo: Repository<GuildMember>,
) {}
list(guildId?: string) {
if (guildId) {
return this.memberRepo.find({ where: { guildId, status: 'active' }, order: { createdAt: 'ASC' }, take: 500 });
}
return this.memberRepo.find({ where: { status: 'active' }, order: { createdAt: 'ASC' }, take: 500 });
}
}