Implement Cloudflare custom domain management flow
- Added support for connecting, refreshing, and removing custom domains through Cloudflare. - Updated API routes and validation schemas to handle new domain actions. - Refactored domain management logic in the dashboard to accommodate Cloudflare integration. - Enhanced user experience with clear status messages and DNS instructions for domain setup. - Updated translations and UI components to reflect new domain management features.
This commit is contained in:
@@ -353,23 +353,21 @@ class OrgApi extends BaseApiWithErrors {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a domain request (verify, add, or remove domain)
|
||||
* @param key Domain operation key: 'verify_domain', 'add_domain', or 'remove_domain'
|
||||
* Sends a domain request (connect, refresh, or remove)
|
||||
* @param action Domain operation action
|
||||
* @param domain Domain name
|
||||
* @returns Domain request response data
|
||||
*/
|
||||
async sendDomainRequest(key: 'verify_domain' | 'add_domain' | 'remove_domain', domain: string) {
|
||||
async sendDomainRequest(action: 'connect' | 'refresh' | 'remove', domain: string) {
|
||||
return this.execute<DomainRequestRequest>({
|
||||
requestFn: () =>
|
||||
classroomio.domain.$post({
|
||||
json: {
|
||||
params: {
|
||||
key,
|
||||
domain
|
||||
}
|
||||
action,
|
||||
domain
|
||||
}
|
||||
}),
|
||||
logContext: `processing domain request: ${key}`,
|
||||
logContext: `processing domain request: ${action}`,
|
||||
onSuccess: () => {
|
||||
this.success = true;
|
||||
this.errors = {};
|
||||
|
||||
@@ -53,6 +53,8 @@ export type UpdateOrganizationSuccess = Extract<UpdateOrganizationResponse, { su
|
||||
export type DomainRequestRequest = typeof classroomio.domain.$post;
|
||||
export type DomainRequestResponse = InferResponseType<DomainRequestRequest>;
|
||||
export type DomainRequestSuccess = Extract<DomainRequestResponse, { success: true }>;
|
||||
export type DomainRequestData = DomainRequestSuccess['data'];
|
||||
export type DomainRequestStatus = DomainRequestData['status'];
|
||||
|
||||
// SSO types
|
||||
export type GetSsoConfigRequest = (typeof classroomio.organization)['sso']['$get'];
|
||||
|
||||
Reference in New Issue
Block a user