Skip to content

Commit

Permalink
Require resource type
Browse files Browse the repository at this point in the history
  • Loading branch information
joecorall committed Nov 19, 2024
1 parent 0fb733d commit 73925e4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/handlers/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ func CheckMyWork(w http.ResponseWriter, r *http.Request) {
"Title",
"Object Model",
"Full Title",
"Resource Type",
}
uploadIds := map[string]bool{}
for rowIndex, row := range csvData[1:] {
Expand Down
10 changes: 10 additions & 0 deletions internal/handlers/check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@ func TestCheckMyWork(t *testing.T) {
statusCode: http.StatusOK,
response: `{"A2":"Missing value"}`,
},
{
name: "Missing resource type",
method: http.MethodPost,
body: [][]string{
{"Title", "Object Model", "Full Title", "Resource Type"},
{"foo", "bar", "foo", ""},
},
statusCode: http.StatusOK,
response: `{"D2":"Missing value"}`,
},
{
name: "Missing model",
method: http.MethodPost,
Expand Down

0 comments on commit 73925e4

Please sign in to comment.