feat(admin-center): implement admin center settings retrieval and enhance holiday population logic

- Added a new API endpoint in AdminCenterController to fetch admin center settings, including organization details.
- Updated the admin center API router to include the new settings route.
- Enhanced the holiday controller to check for recent holiday population before attempting to repopulate, preventing duplicate entries.
- Improved the holiday calendar component to manage holiday population attempts and display loading states.
- Updated localization files to support new messages related to calculation methods and holiday settings.
This commit is contained in:
chamikaJ
2025-07-30 11:35:12 +05:30
parent 069ae6ccb1
commit 9dfc1fa375
19 changed files with 340 additions and 226 deletions

View File

@@ -83,6 +83,14 @@ export const fetchOrganizationDetails = createAsyncThunk(
}
);
export const fetchAdminCenterSettings = createAsyncThunk(
'adminCenter/fetchAdminCenterSettings',
async () => {
const res = await adminCenterApiService.getAdminCenterSettings();
return res.body;
}
);
export const fetchOrganizationAdmins = createAsyncThunk(
'adminCenter/fetchOrganizationAdmins',
async () => {
@@ -207,6 +215,17 @@ const adminCenterSlice = createSlice({
state.loadingOrganization = false;
});
builder.addCase(fetchAdminCenterSettings.pending, (state, action) => {
state.loadingOrganization = true;
});
builder.addCase(fetchAdminCenterSettings.fulfilled, (state, action) => {
state.organization = action.payload;
state.loadingOrganization = false;
});
builder.addCase(fetchAdminCenterSettings.rejected, (state, action) => {
state.loadingOrganization = false;
});
builder.addCase(fetchOrganizationAdmins.pending, (state, action) => {
state.loadingOrganizationAdmins = true;
});