Skip to content

Commit 6eed358

Browse files
committed
fix: Always showed successful message even when it should not #145
1 parent d1e474e commit 6eed358

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

source/Public/Warehouse/Remove-FabricWarehouse.ps1

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,13 @@ function Remove-FabricWarehouse
4444

4545
if ($PSCmdlet.ShouldProcess($apiEndpointURI, "Delete Warehouse"))
4646
{
47-
# Step 3: Make the API request
48-
$response = Invoke-FabricRestMethod `
49-
-Uri $apiEndpointURI `
50-
-method Delete `
47+
# Step 3: Make the API request and Validate the response
48+
$response = Invoke-FabricRestMethod -Uri $apiEndpointURI -Method Delete
49+
$response = Test-FabricApiResponse -response $response -ObjectIdOrName $WarehouseId -typeName "Warehouse"
5150
}
5251

53-
Write-Message -Message "Warehouse '$WarehouseId' deleted successfully from workspace '$WorkspaceId'." -Level Info
54-
return $response
52+
# Step 4: Handle results
53+
$response
5554

5655
}
5756
catch

0 commit comments

Comments
 (0)