Skip to content

Commit e8fb5b5

Browse files
committed
changes in createKvdb
1 parent 9c6f61a commit e8fb5b5

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

Sources/PrivMXEndpointSwift/Kvdbs/KvdbApi.swift

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,21 @@ public class KvdbApi: @unchecked Sendable{
6464
managers: privmx.UserWithPubKeyVector,
6565
publicMeta: privmx.endpoint.core.Buffer,
6666
privateMeta: privmx.endpoint.core.Buffer,
67-
policies: privmx.OptionalContainerPolicy = nil
67+
policies: privmx.endpoint.core.ContainerPolicy? = nil
6868
) throws -> std.string {
69+
70+
var optPolicies = privmx.OptionalContainerPolicy()
71+
if let policies{
72+
optPolicies = privmx.makeOptional(policies)
73+
}
74+
6975
let res = api.createKvdb(
7076
contextId,
7177
users,
7278
managers,
7379
publicMeta,
7480
privateMeta,
75-
policies)
81+
optPolicies)
7682
guard res.error.value == nil else {
7783
throw PrivMXEndpointError.failedCreatingKvdb(res.error.value!)
7884
}

Sources/PrivMXEndpointSwiftNative/NativeKvdbApiWrapper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ ResultWithError<NativeKvdbApiWrapper> NativeKvdbApiWrapper::create(NativeConnect
4343
return res;
4444
}
4545

46-
ResultWithError<std::string> NativeKvdbApiWrapper::createKvdb(const std::string& kvdbId,
46+
ResultWithError<std::string> NativeKvdbApiWrapper::createKvdb(const std::string& contextId,
4747
const UserWithPubKeyVector& users,
4848
const UserWithPubKeyVector& managers,
4949
const endpoint::core::Buffer& publicMeta,
5050
const endpoint::core::Buffer& privateMeta,
5151
const OptionalContainerPolicy& policies){
5252
auto res = ResultWithError<std::string>();
5353
try{
54-
res.result = getapi()->createKvdb(kvdbId,
54+
res.result = getapi()->createKvdb(contextId,
5555
users,
5656
managers,
5757
publicMeta,

0 commit comments

Comments
 (0)