@@ -288,15 +288,31 @@ jsi::Value storeSetDefaultProfile(jsi::Runtime &rt, jsi::Object options) {
288288
289289jsi::Value storeRenameProfile (jsi::Runtime &rt, jsi::Object options) {
290290 auto storeHandle = jsiToValue<int64_t >(rt, options, " storeHandle" );
291- auto fromName = jsiToValue<std::string>(rt, options, " fromName " );
292- auto toName = jsiToValue<std::string>(rt, options, " toName " );
291+ auto fromProfile = jsiToValue<std::string>(rt, options, " fromProfile " );
292+ auto toProfile = jsiToValue<std::string>(rt, options, " toProfile " );
293293
294294 jsi::Function cb = options.getPropertyAsFunction (rt, " cb" );
295295 State *state = new State (&cb);
296296 state->rt = &rt;
297297
298298 ErrorCode code = askar_store_rename_profile (
299- storeHandle, fromName.c_str (), toName.c_str (), callbackWithResponse, CallbackId (state));
299+ storeHandle, fromProfile.c_str (), toProfile.c_str (), callbackWithResponse, CallbackId (state));
300+
301+ return createReturnValue (rt, code, nullptr );
302+ }
303+
304+ jsi::Value storeCopyProfile (jsi::Runtime &rt, jsi::Object options) {
305+ auto fromHandle = jsiToValue<int64_t >(rt, options, " fromHandle" );
306+ auto toHandle = jsiToValue<int64_t >(rt, options, " toHandle" );
307+ auto fromProfile = jsiToValue<std::string>(rt, options, " fromProfile" );
308+ auto toProfile = jsiToValue<std::string>(rt, options, " toProfile" );
309+
310+ jsi::Function cb = options.getPropertyAsFunction (rt, " cb" );
311+ State *state = new State (&cb);
312+ state->rt = &rt;
313+
314+ ErrorCode code = askar_store_copy_profile (
315+ fromHandle, toHandle, fromProfile.c_str (), toProfile.c_str (), callbackWithResponse, CallbackId (state));
300316
301317 return createReturnValue (rt, code, nullptr );
302318}
0 commit comments