Skip to content

Commit

Permalink
Set UpdatedAt, not just DeletedAt.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTedder committed Oct 23, 2024
1 parent a030d64 commit 37117ec
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 35 deletions.
4 changes: 3 additions & 1 deletion LeaderboardBackend.Test/Leaderboards.cs
Original file line number Diff line number Diff line change
Expand Up @@ -597,12 +597,14 @@ await FluentActions.Awaiting(() => _apiClient.Delete(
public async Task DeleteLeaderboard_AlreadyDeleted()
{
ApplicationContext context = _factory.Services.CreateScope().ServiceProvider.GetRequiredService<ApplicationContext>();
Instant now = _clock.GetCurrentInstant();

Leaderboard lb = new()
{
Name = "The Elder Scrolls V: Skyrim",
Slug = "tesv-skyrim",
DeletedAt = _clock.GetCurrentInstant()
UpdatedAt = now,
DeletedAt = now
};

context.Leaderboards.Add(lb);
Expand Down
68 changes: 34 additions & 34 deletions LeaderboardBackend/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -664,13 +664,13 @@
}
}
},
"/leaderboard/{id}": {
"delete": {
"/leaderboard/{id}/restore": {
"put": {
"tags": [
"Leaderboards"
],
"summary": "Deletes a leaderboard. This request is restricted to Administrators.",
"operationId": "deleteLeaderboard",
"summary": "Restores a deleted leaderboard.",
"operationId": "restoreLeaderboard",
"parameters": [
{
"name": "id",
Expand All @@ -696,35 +696,52 @@
"500": {
"description": "Internal Server Error"
},
"204": {
"description": "No Content"
"200": {
"description": "The restored `Leaderboard`s view model.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LeaderboardViewModel"
}
}
}
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
"description": "The requesting `User` is unauthorized to restore `Leaderboard`s."
},
"404": {
"description": "The leaderboard does not exist (Not Found) or was already deleted (Already Deleted).\nUse the title field of the response to differentiate between the two cases if necessary.",
"description": "The `Leaderboard` was not found, or it wasn't deleted in the first place. Includes a field, `title`, which will be \"Not Found\" in the former case, and \"Not Deleted\" in the latter.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
},
"409": {
"description": "Another `Leaderboard` with the same slug has been created since, and therefore can't be restored. Will include the conflicting board in the response.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LeaderboardViewModel"
}
}
}
}
}
}
},
"/leaderboard/{id}/restore": {
"put": {
"/leaderboard/{id}": {
"delete": {
"tags": [
"Leaderboards"
],
"summary": "Restores a deleted leaderboard.",
"operationId": "restoreLeaderboard",
"summary": "Deletes a leaderboard. This request is restricted to Administrators.",
"operationId": "deleteLeaderboard",
"parameters": [
{
"name": "id",
Expand All @@ -750,41 +767,24 @@
"500": {
"description": "Internal Server Error"
},
"200": {
"description": "The restored `Leaderboard`s view model.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LeaderboardViewModel"
}
}
}
"204": {
"description": "No Content"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "The requesting `User` is unauthorized to restore `Leaderboard`s."
"description": "Forbidden"
},
"404": {
"description": "The `Leaderboard` was not found, or it wasn't deleted in the first place. Includes a field, `title`, which will be \"Not Found\" in the former case, and \"Not Deleted\" in the latter.",
"description": "The leaderboard does not exist (Not Found) or was already deleted (Already Deleted).\nUse the title field of the response to differentiate between the two cases if necessary.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ProblemDetails"
}
}
}
},
"409": {
"description": "Another `Leaderboard` with the same slug has been created since, and therefore can't be restored. Will include the conflicting board in the response.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/LeaderboardViewModel"
}
}
}
}
}
}
Expand Down Expand Up @@ -1610,4 +1610,4 @@
"Bearer": [ ]
}
]
}
}

0 comments on commit 37117ec

Please sign in to comment.