feat: add manual sync functionality with confirmation modal in ArrModal component

This commit is contained in:
Sam Chau
2025-01-09 19:46:41 +10:30
parent 2c19df5503
commit fba319eee2
4 changed files with 125 additions and 4 deletions

View File

@@ -72,3 +72,18 @@ export const deleteArrConfig = async id => {
throw error;
}
};
export const triggerSync = async configId => {
try {
const response = await fetch(`/api/arr/config/${configId}/sync`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
});
return await response.json();
} catch (error) {
console.error('Error triggering sync:', error);
return {success: false, error: error.message};
}
};