@@ -27,7 +27,7 @@ import enhanceParameters from '@libs/Network/enhanceParameters';
2727import { generateAccountID } from '@libs/UserUtils' ;
2828import CONST from '@src/CONST' ;
2929import ONYXKEYS from '@src/ONYXKEYS' ;
30- import type { Domain , DomainSecurityGroup , UserSecurityGroupData } from '@src/types/onyx' ;
30+ import type { DomainSecurityGroup , UserSecurityGroupData } from '@src/types/onyx' ;
3131import type { SecurityGroupKey } from '@src/types/onyx/Domain' ;
3232import type { DomainSecurityGroupErrors } from '@src/types/onyx/DomainErrors' ;
3333import type { PendingAction } from '@src/types/onyx/OnyxCommon' ;
@@ -765,7 +765,7 @@ function revokeDomainAdminAccess(domainAccountID: number, accountID: number) {
765765/**
766766 * Removes the domain
767767 */
768- function resetDomain ( domainAccountID : number , domainName : string , domain : Domain ) {
768+ function resetDomain ( domainAccountID : number , domainName : string ) {
769769 const optimisticData : Array < OnyxUpdate < typeof ONYXKEYS . COLLECTION . DOMAIN_PENDING_ACTIONS | typeof ONYXKEYS . COLLECTION . DOMAIN > > = [
770770 {
771771 onyxMethod : Onyx . METHOD . MERGE ,
@@ -777,10 +777,15 @@ function resetDomain(domainAccountID: number, domainName: string, domain: Domain
777777 {
778778 onyxMethod : Onyx . METHOD . MERGE ,
779779 key : `${ ONYXKEYS . COLLECTION . DOMAIN } ${ domainAccountID } ` ,
780- value : null ,
780+ value : { pendingAction : CONST . RED_BRICK_ROAD_PENDING_ACTION . DELETE } ,
781781 } ,
782782 ] ;
783- const successData : Array < OnyxUpdate < typeof ONYXKEYS . COLLECTION . DOMAIN_PENDING_ACTIONS | typeof ONYXKEYS . COLLECTION . DOMAIN_ERRORS > > = [
783+ const successData : Array < OnyxUpdate < typeof ONYXKEYS . COLLECTION . DOMAIN | typeof ONYXKEYS . COLLECTION . DOMAIN_PENDING_ACTIONS | typeof ONYXKEYS . COLLECTION . DOMAIN_ERRORS > > = [
784+ {
785+ onyxMethod : Onyx . METHOD . SET ,
786+ key : `${ ONYXKEYS . COLLECTION . DOMAIN } ${ domainAccountID } ` ,
787+ value : null ,
788+ } ,
784789 {
785790 onyxMethod : Onyx . METHOD . MERGE ,
786791 key : `${ ONYXKEYS . COLLECTION . DOMAIN_PENDING_ACTIONS } ${ domainAccountID } ` ,
@@ -800,7 +805,7 @@ function resetDomain(domainAccountID: number, domainName: string, domain: Domain
800805 {
801806 onyxMethod : Onyx . METHOD . MERGE ,
802807 key : `${ ONYXKEYS . COLLECTION . DOMAIN } ${ domainAccountID } ` ,
803- value : domain ,
808+ value : { pendingAction : null } ,
804809 } ,
805810 {
806811 onyxMethod : Onyx . METHOD . MERGE ,
0 commit comments