From b83ad03a47cd38eaa1e0c3bde787a8e1c9b33b88 Mon Sep 17 00:00:00 2001 From: Andrew Hill Date: Wed, 19 Aug 2020 14:25:45 -0700 Subject: [PATCH] fix(api): use newer getOrInit method Signed-off-by: Andrew Hill --- node_common/utilities.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node_common/utilities.js b/node_common/utilities.js index 2a6fe306..d5f6f7c0 100644 --- a/node_common/utilities.js +++ b/node_common/utilities.js @@ -70,9 +70,9 @@ export const getBucketAPIFromUserToken = async (token) => { const identity = await PrivateKey.fromString(token); const buckets = await Buckets.withKeyInfo(TEXTILE_KEY_INFO); await buckets.getToken(identity); - const root = await buckets.open(BUCKET_NAME); + const target = await buckets.getOrInit(BUCKET_NAME); - return { buckets, bucketKey: root.key, bucketName: BUCKET_NAME }; + return { buckets, bucketKey: target.root.key, bucketName: BUCKET_NAME }; }; // NOTE(jim): Requires Powergate, does not require token.