Disable the debug console logs for production
This commit is contained in:
@@ -22,13 +22,13 @@ export interface AlertConfiguration {
|
||||
|
||||
export const alertConfigService = {
|
||||
async getAlertConfigurations(): Promise<AlertConfiguration[]> {
|
||||
console.info("Fetching alert configurations");
|
||||
// console.info("Fetching alert configurations");
|
||||
try {
|
||||
const response = await pb.collection('alert_configurations').getList(1, 50);
|
||||
console.info("Alert configurations response:", response);
|
||||
// console.info("Alert configurations response:", response);
|
||||
return response.items as AlertConfiguration[];
|
||||
} catch (error) {
|
||||
console.error("Error fetching alert configurations:", error);
|
||||
// console.error("Error fetching alert configurations:", error);
|
||||
toast({
|
||||
title: "Error",
|
||||
description: "Failed to load notification settings",
|
||||
@@ -39,17 +39,17 @@ export const alertConfigService = {
|
||||
},
|
||||
|
||||
async createAlertConfiguration(config: Omit<AlertConfiguration, 'id' | 'collectionId' | 'collectionName' | 'created' | 'updated'>): Promise<AlertConfiguration | null> {
|
||||
console.info("Creating alert configuration:", config);
|
||||
// console.info("Creating alert configuration:", config);
|
||||
try {
|
||||
const result = await pb.collection('alert_configurations').create(config);
|
||||
console.info("Alert configuration created:", result);
|
||||
// console.info("Alert configuration created:", result);
|
||||
toast({
|
||||
title: "Success",
|
||||
description: "Notification settings saved successfully",
|
||||
});
|
||||
return result as AlertConfiguration;
|
||||
} catch (error) {
|
||||
console.error("Error creating alert configuration:", error);
|
||||
// console.error("Error creating alert configuration:", error);
|
||||
toast({
|
||||
title: "Error",
|
||||
description: "Failed to save notification settings",
|
||||
@@ -60,17 +60,17 @@ export const alertConfigService = {
|
||||
},
|
||||
|
||||
async updateAlertConfiguration(id: string, config: Partial<AlertConfiguration>): Promise<AlertConfiguration | null> {
|
||||
console.info(`Updating alert configuration ${id}:`, config);
|
||||
// console.info(`Updating alert configuration ${id}:`, config);
|
||||
try {
|
||||
const result = await pb.collection('alert_configurations').update(id, config);
|
||||
console.info("Alert configuration updated:", result);
|
||||
// console.info("Alert configuration updated:", result);
|
||||
toast({
|
||||
title: "Success",
|
||||
description: "Notification settings updated successfully",
|
||||
});
|
||||
return result as AlertConfiguration;
|
||||
} catch (error) {
|
||||
console.error("Error updating alert configuration:", error);
|
||||
// console.error("Error updating alert configuration:", error);
|
||||
toast({
|
||||
title: "Error",
|
||||
description: "Failed to update notification settings",
|
||||
@@ -81,17 +81,17 @@ export const alertConfigService = {
|
||||
},
|
||||
|
||||
async deleteAlertConfiguration(id: string): Promise<boolean> {
|
||||
console.info(`Deleting alert configuration ${id}`);
|
||||
// console.info(`Deleting alert configuration ${id}`);
|
||||
try {
|
||||
await pb.collection('alert_configurations').delete(id);
|
||||
console.info("Alert configuration deleted");
|
||||
// console.info("Alert configuration deleted");
|
||||
toast({
|
||||
title: "Success",
|
||||
description: "Notification channel removed",
|
||||
});
|
||||
return true;
|
||||
} catch (error) {
|
||||
console.error("Error deleting alert configuration:", error);
|
||||
// console.error("Error deleting alert configuration:", error);
|
||||
toast({
|
||||
title: "Error",
|
||||
description: "Failed to remove notification channel",
|
||||
|
||||
Reference in New Issue
Block a user