@@ -29,7 +29,7 @@ import enhanceParameters from '@libs/Network/enhanceParameters';
2929import { generateAccountID } from '@libs/UserUtils' ;
3030import CONST from '@src/CONST' ;
3131import ONYXKEYS from '@src/ONYXKEYS' ;
32- import type { Domain , DomainSecurityGroup , UserSecurityGroupData } from '@src/types/onyx' ;
32+ import type { DomainSecurityGroup , UserSecurityGroupData } from '@src/types/onyx' ;
3333import type { SecurityGroupKey } from '@src/types/onyx/Domain' ;
3434import type { DomainSecurityGroupErrors } from '@src/types/onyx/DomainErrors' ;
3535import type { PendingAction } from '@src/types/onyx/OnyxCommon' ;
@@ -767,7 +767,7 @@ function revokeDomainAdminAccess(domainAccountID: number, accountID: number) {
767767/**
768768 * Removes the domain
769769 */
770- function resetDomain ( domainAccountID : number , domainName : string , domain : Domain ) {
770+ function resetDomain ( domainAccountID : number , domainName : string ) {
771771 const optimisticData : Array < OnyxUpdate < typeof ONYXKEYS . COLLECTION . DOMAIN_PENDING_ACTIONS | typeof ONYXKEYS . COLLECTION . DOMAIN > > = [
772772 {
773773 onyxMethod : Onyx . METHOD . MERGE ,
@@ -779,10 +779,15 @@ function resetDomain(domainAccountID: number, domainName: string, domain: Domain
779779 {
780780 onyxMethod : Onyx . METHOD . MERGE ,
781781 key : `${ ONYXKEYS . COLLECTION . DOMAIN } ${ domainAccountID } ` ,
782- value : null ,
782+ value : { pendingAction : CONST . RED_BRICK_ROAD_PENDING_ACTION . DELETE } ,
783783 } ,
784784 ] ;
785- const successData : Array < OnyxUpdate < typeof ONYXKEYS . COLLECTION . DOMAIN_PENDING_ACTIONS | typeof ONYXKEYS . COLLECTION . DOMAIN_ERRORS > > = [
785+ const successData : Array < OnyxUpdate < typeof ONYXKEYS . COLLECTION . DOMAIN | typeof ONYXKEYS . COLLECTION . DOMAIN_PENDING_ACTIONS | typeof ONYXKEYS . COLLECTION . DOMAIN_ERRORS > > = [
786+ {
787+ onyxMethod : Onyx . METHOD . SET ,
788+ key : `${ ONYXKEYS . COLLECTION . DOMAIN } ${ domainAccountID } ` ,
789+ value : null ,
790+ } ,
786791 {
787792 onyxMethod : Onyx . METHOD . MERGE ,
788793 key : `${ ONYXKEYS . COLLECTION . DOMAIN_PENDING_ACTIONS } ${ domainAccountID } ` ,
@@ -802,7 +807,7 @@ function resetDomain(domainAccountID: number, domainName: string, domain: Domain
802807 {
803808 onyxMethod : Onyx . METHOD . MERGE ,
804809 key : `${ ONYXKEYS . COLLECTION . DOMAIN } ${ domainAccountID } ` ,
805- value : domain ,
810+ value : { pendingAction : null } ,
806811 } ,
807812 {
808813 onyxMethod : Onyx . METHOD . MERGE ,
0 commit comments