fix: connect remaining sms pages to real backend
This commit is contained in:
@@ -7,6 +7,12 @@ export interface CreateTenantDto {
|
||||
status?: string;
|
||||
}
|
||||
|
||||
export interface UpdateTenantDto {
|
||||
name?: string;
|
||||
code?: string;
|
||||
status?: string;
|
||||
}
|
||||
|
||||
@Injectable()
|
||||
export class TenantsService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
@@ -31,4 +37,26 @@ export class TenantsService {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
update(id: string, data: UpdateTenantDto) {
|
||||
return this.prisma.tenant.update({
|
||||
where: { id },
|
||||
data: {
|
||||
name: data.name,
|
||||
code: data.code,
|
||||
status: data.status,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
changeStatus(id: string, status: string) {
|
||||
return this.prisma.tenant.update({
|
||||
where: { id },
|
||||
data: { status },
|
||||
});
|
||||
}
|
||||
|
||||
delete(id: string) {
|
||||
return this.changeStatus(id, 'deleted');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user