mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat: Add SMS Integration & SMS Message Form.
This commit is contained in:
@@ -125,7 +125,7 @@ export function useSettingCashFlow(props) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve SMS settings.
|
||||
* Retrieve SMS Notifications settings.
|
||||
*/
|
||||
export function useSettingSMSNotifications(props) {
|
||||
return useRequestQuery(
|
||||
@@ -138,3 +138,42 @@ export function useSettingSMSNotifications(props) {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve Specific SMS Notification settings.
|
||||
*/
|
||||
export function useSettingSMSNotification(key, props) {
|
||||
return useRequestQuery(
|
||||
[t.SETTING_SMS_NOTIFICATIONS, key],
|
||||
{
|
||||
method: 'get',
|
||||
url: `settings/sms-notification/${key}`,
|
||||
},
|
||||
{
|
||||
select: (res) => res.data.notification,
|
||||
defaultData: {
|
||||
smsNotification: [],
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve Edit SMS Notification settings.
|
||||
*/
|
||||
export function useSettingEditSMSNotification(props) {
|
||||
const queryClient = useQueryClient();
|
||||
const apiRequest = useApiRequest();
|
||||
|
||||
return useMutation(
|
||||
(values) => apiRequest.post(`settings/sms-notification`, values),
|
||||
{
|
||||
onSuccess: () => {
|
||||
// Invalidate
|
||||
queryClient.invalidateQueries([t.SETTING_SMS_NOTIFICATIONS]);
|
||||
},
|
||||
...props,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,9 @@ const SETTING = {
|
||||
SETTING_MANUAL_JOURNALS: 'SETTING_MANUAL_JOURNALS',
|
||||
SETTING_ITEMS: 'SETTING_ITEMS',
|
||||
SETTING_CASHFLOW: 'SETTING_CASHFLOW',
|
||||
SETTING_SMS_NOTIFICATION: 'SETTING_SMS_NOTIFICATION',
|
||||
SETTING_SMS_NOTIFICATIONS: 'SETTING_SMS_NOTIFICATIONS',
|
||||
SETTING_EDIT_SMS_NOTIFICATION: 'SETTING_EDIT_SMS_NOTIFICATION',
|
||||
};
|
||||
|
||||
const ORGANIZATIONS = {
|
||||
|
||||
Reference in New Issue
Block a user