🐛 FIX: Domain remote id

This commit is contained in:
Austin Ginder 2025-09-23 20:28:54 -04:00
parent f1e4399f8d
commit 69af3a8c48

View file

@ -89,7 +89,7 @@ class Domain {
}

// Search API for domain ID
foreach ( $constellix_all_domains as $item ) {
foreach ( $constellix_all_domains->data as $item ) {
if ( $domain->name == $item->name ) {
$remote_id = $item->id;
break;
@ -111,9 +111,12 @@ class Domain {
];
}
$response = Remote\Constellix::post( 'domains', $arguments );
if ( ! empty( $response->data ) ) {
$remote_id = $response->data->id;
}

}

if ( ! empty( $response->errors ) ) {
return [ "errors" => $response->errors ];
}