Add complete to line PATCH options.

`complete` is a boolean.

If true, any virgin points remaining on the line
will be marked as `ntba=true`.

If false, *all* points on the line will be marked
as `ntba=false`.
This commit is contained in:
D. Berge
2021-05-17 20:15:34 +02:00
parent f297458954
commit 8e71b18225

View File

@@ -7,6 +7,9 @@ async function patch (projectId, line, payload, opts = {}) {
"remarks": "UPDATE preplot_lines SET remarks = $2 WHERE line = $1 AND class ='V';", "remarks": "UPDATE preplot_lines SET remarks = $2 WHERE line = $1 AND class ='V';",
"meta": "UPDATE preplot_lines SET meta = $2 WHERE line = $1 AND class ='V';", "meta": "UPDATE preplot_lines SET meta = $2 WHERE line = $1 AND class ='V';",
"ntba": "UPDATE preplot_lines SET ntba = $2 WHERE line = $1 AND class ='V';", "ntba": "UPDATE preplot_lines SET ntba = $2 WHERE line = $1 AND class ='V';",
"complete": "UPDATE preplot_points pp SET ntba = $2 FROM preplot_points_count ppc WHERE pp.line = ppc.line AND pp.point = ppc.point AND pp.line = $1 AND ($2 = false OR ppc.count = 0);"
// NOTE on the "complete" query: if complete is true it sets *only* virgin points to NTBA=true,
// but if complete is false it sets all points on the line to NTBA=false.
}; };
try { try {