File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,12 @@ public function toAttributes(Request $request): array
1717 'guid ' => $ this ->guid ,
1818 'name ' => $ this ->name ,
1919 'message ' => $ this ->message ,
20- 'component_id ' => $ this ->component_id ,
2120 'visible ' => $ this ->visible ,
2221 'stickied ' => $ this ->stickied ,
2322 'notifications ' => $ this ->notifications ,
23+ 'components_count ' => $ this ->whenCounted ('components ' , function () {
24+ return $ this ->components_count ;
25+ }),
2426 'status ' => [
2527 'human ' => $ this ->latestStatus ?->getLabel(),
2628 'value ' => $ this ->latestStatus ?->value,
Original file line number Diff line number Diff line change 278278
279279 expect ($ componentBResource ['attributes ' ]['pivot ' ]['component_status ' ]['value ' ])
280280 ->toBe (ComponentStatusEnum::major_outage->value );
281+
282+ // Verify the components relationship is properly returned (no component_id attribute)
283+ expect ($ response ->json ('data.attributes ' ))->not ->toHaveKey ('component_id ' );
284+ expect ($ response ->json ('data.relationships.components.data ' ))->toHaveCount (2 );
281285});
282286
283287it ('can create an incident with a template ' , function () {
You can’t perform that action at this time.
0 commit comments