mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-26 19:04:23 +00:00
feat(agent): add teamId foreign key to agent table and refactor service queries
This commit is contained in:
@@ -120,6 +120,11 @@ describe('TeamService', () => {
|
||||
const user = await prisma.user.create({
|
||||
data: { name: 'Human', email: `human-${Date.now()}@example.com`, password: 'pw' },
|
||||
})
|
||||
|
||||
const team = await teamService.createTeam(user, {
|
||||
name: 'Test Team',
|
||||
})
|
||||
|
||||
const bot = await prisma.user.create({
|
||||
data: {
|
||||
name: 'Bot',
|
||||
@@ -128,6 +133,7 @@ describe('TeamService', () => {
|
||||
type: 'agent',
|
||||
agent: {
|
||||
create: {
|
||||
teamId: team.id,
|
||||
type: 'chat',
|
||||
enabled: true,
|
||||
config: {
|
||||
@@ -139,10 +145,6 @@ describe('TeamService', () => {
|
||||
},
|
||||
})
|
||||
|
||||
const team = await teamService.createTeam(user, {
|
||||
name: 'Test Team',
|
||||
})
|
||||
|
||||
await teamService.joinTeam({
|
||||
teamId: team.id,
|
||||
userId: bot.id,
|
||||
|
||||
Reference in New Issue
Block a user