aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-11-18 09:07:00 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-11-18 09:07:00 +0200
commitb03540a7dc9d47c3c6e095a5dfae848770d5feff (patch)
treefdccf2343e77d339b7bbb80f792a873b23017538
parent188032cde85341606a1d1a17791f043ddbd87381 (diff)
Return tenant archived indication from ci_start::find()
-rw-r--r--mod/ci-common.cxx9
-rw-r--r--mod/ci-common.hxx5
2 files changed, 7 insertions, 7 deletions
diff --git a/mod/ci-common.cxx b/mod/ci-common.cxx
index cc361d2..d750b1b 100644
--- a/mod/ci-common.cxx
+++ b/mod/ci-common.cxx
@@ -988,7 +988,7 @@ namespace brep
return s;
}
- optional<tenant_service> ci_start::
+ optional<pair<tenant_service, bool>> ci_start::
find (odb::core::database& db,
const string& type,
const string& id) const
@@ -1007,10 +1007,9 @@ namespace brep
tr.commit ();
- optional<tenant_service> r;
- if (t != nullptr)
- r = move (t->service);
+ if (t == nullptr)
+ return nullopt;
- return r;
+ return pair<tenant_service, bool> (move (t->service), t->archived);
}
}
diff --git a/mod/ci-common.hxx b/mod/ci-common.hxx
index 6d21ba5..36d5f0e 100644
--- a/mod/ci-common.hxx
+++ b/mod/ci-common.hxx
@@ -236,11 +236,12 @@ namespace brep
build_state)> = nullptr) const;
// Find the tenant given the tenant service type and id and return the
- // associated data or nullopt if there is no such tenant.
+ // associated data plus the indication of whether the tenant is archived,
+ // or nullopt if there is no such tenant.
//
// Note: should be called out of the database transaction.
//
- optional<tenant_service>
+ optional<pair<tenant_service, bool /*archived*/>>
find (odb::core::database&,
const string& type,
const string& id) const;