Return Location header only when using Prefer: return=header-only

This commit is contained in:
Laurence Isla
2022-06-24 12:53:27 -05:00
committed by GitHub
parent f7745e1569
commit 169547aee6
4 changed files with 39 additions and 30 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ createWriteStatement selectQuery mutateQuery wantSingle isInsert asCsv asGeoJson
"FROM (" <> selectF <> ") _postgrest_t"
locF =
if isInsert && rep /= None
if isInsert && rep == HeadersOnly
then BS.unwords [
"CASE WHEN pg_catalog.count(_postgrest_t) = 1",
"THEN coalesce(" <> locationF pKeys <> ", " <> noLocationF <> ")",