mirror of
https://github.com/open-reception/appointment-booking-software.git
synced 2026-08-17 21:25:52 +02:00
Fix/channel is public api (#93)
* Channel pause * Fix tenant config GET * Fixed test
This commit is contained in:
@@ -35,6 +35,7 @@ const channelUpdateSchema = z.object({
|
||||
color: z.string().optional(),
|
||||
descriptions: z.partialRecord(z.enum(supportedLocales), z.string().min(1)).optional(),
|
||||
isPublic: z.boolean().optional(),
|
||||
pause: z.boolean().optional(),
|
||||
requiresConfirmation: z.boolean().optional(),
|
||||
agentIds: z.array(z.string().uuid()).optional(),
|
||||
slotTemplates: z
|
||||
@@ -125,7 +126,8 @@ export class ChannelService {
|
||||
names: request.names,
|
||||
color: request.color,
|
||||
descriptions: request.descriptions || {},
|
||||
isPublic: request.isPublic,
|
||||
isPublic: request.isPublic ?? false,
|
||||
pause: false,
|
||||
requiresConfirmation: request.requiresConfirmation,
|
||||
})
|
||||
.returning();
|
||||
@@ -240,6 +242,7 @@ export class ChannelService {
|
||||
color: updateData.color,
|
||||
descriptions: updateData.descriptions,
|
||||
isPublic: updateData.isPublic,
|
||||
pause: updateData.pause,
|
||||
requiresConfirmation: updateData.requiresConfirmation,
|
||||
};
|
||||
|
||||
|
||||
@@ -192,7 +192,7 @@ export const GET: RequestHandler = async ({ locals, params }) => {
|
||||
checkPermission(locals, tenantId, true);
|
||||
|
||||
const tenantService = await TenantAdminService.getTenantById(tenantId);
|
||||
const config = await tenantService.configuration;
|
||||
const config = await tenantService.configuration.configuration;
|
||||
|
||||
log.debug("Tenant configuration retrieved successfully", {
|
||||
tenantId,
|
||||
|
||||
@@ -157,7 +157,9 @@ describe("Tenant API Routes", () => {
|
||||
};
|
||||
|
||||
const mockTenantService = {
|
||||
configuration: mockConfig,
|
||||
configuration: {
|
||||
configuration: mockConfig,
|
||||
},
|
||||
};
|
||||
|
||||
vi.mocked(TenantAdminService.getTenantById).mockResolvedValue(mockTenantService as any);
|
||||
|
||||
Reference in New Issue
Block a user