Skip to content

Commit dd32372

Browse files
committed
Modify CreatedAtAction parameter, It has an error
1 parent 523d27a commit dd32372

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

eShopOnContainers-ServicesAndWebApps.sln

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,6 @@ EndProject
9595
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Marketing", "Marketing", "{A5260DE0-1FDD-467E-9CC1-A028AB081CEE}"
9696
EndProject
9797
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Marketing.API", "src\Services\Marketing\Marketing.API\Marketing.API.csproj", "{DF395F85-B010-465D-857A-7EBCC512C0C2}"
98-
ProjectSection(ProjectDependencies) = postProject
99-
{0044B293-1DCC-4224-B948-00CF6DC7F510} = {0044B293-1DCC-4224-B948-00CF6DC7F510}
100-
{22A0F9C1-2D4A-4107-95B7-8459E6688BC5} = {22A0F9C1-2D4A-4107-95B7-8459E6688BC5}
101-
{942ED6E8-0050-495F-A0EA-01E97F63760C} = {942ED6E8-0050-495F-A0EA-01E97F63760C}
102-
EndProjectSection
10398
EndProject
10499
Global
105100
GlobalSection(SolutionConfigurationPlatforms) = preSolution

src/Services/Marketing/Marketing.API/Controllers/LocationsController.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ public LocationsController(MarketingContext context)
2020
}
2121

2222
[HttpGet]
23-
[Route("api/v1/campaigns/{campaignId:int}/locations/{userLocationRuleId:int}",
24-
Name = "GetLocationByCampaignAndLocationRuleId")]
23+
[Route("api/v1/campaigns/{campaignId:int}/locations/{userLocationRuleId:int}")]
2524
public IActionResult GetLocationByCampaignAndLocationRuleId(int campaignId,
2625
int userLocationRuleId)
2726
{
@@ -84,8 +83,8 @@ public async Task<IActionResult> CreateLocation(int campaignId,
8483
await _context.Rules.AddAsync(locationRule);
8584
await _context.SaveChangesAsync();
8685

87-
return CreatedAtRoute("GetLocationByCampaignAndLocationRuleId",
88-
new { campaignId = campaignId, locationRuleId = locationRule.Id }, null);
86+
return CreatedAtAction(nameof(GetLocationByCampaignAndLocationRuleId),
87+
new { campaignId = campaignId, userLocationRuleId = locationRule.Id }, null);
8988
}
9089

9190
[HttpDelete]

0 commit comments

Comments
 (0)