From 9d8801ae8f3736d32fbea8e636ff9f4236adab25 Mon Sep 17 00:00:00 2001 From: arsenije Date: Mon, 1 Apr 2024 08:25:47 -0600 Subject: [PATCH] fix(actions): add correct param for settings (#2600) --- src/store/dao/actions.js | 46 ++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/src/store/dao/actions.js b/src/store/dao/actions.js index c679c750d..e02768054 100644 --- a/src/store/dao/actions.js +++ b/src/store/dao/actions.js @@ -139,36 +139,26 @@ export const updateDAOSettings = async function ({ state, rootState }, { data, a name: 'setdaosetting', data: { dao_id: rootState.dao.docId, - // kvs: [[ - // { label: 'voice_token_decay_period', value: ['int64', 1] }, - // { label: 'voice_token_decay_per_period_x10M', value: ['int64', 1] } - // ]] + kvs: Object.keys(data).map(key => { + const valueTypes = { + // _s for string + // _i for int64 + // _n for name + // _t for time_point + // _a for asset - kvs: [ - { key: 'voice_token_decay_period', value: ['int64', 1] }, - { key: 'voice_token_decay_per_period_x10M', value: ['int64', 1] } - ] + number: 'int64', + string: 'string' + } + + const value = data[key] + const type = valueTypes[typeof value] - // kvs: Object.keys(data).map(key => { - // const valueTypes = { - // // _s for string - // // _i for int64 - // // _n for name - // // _t for time_point - // // _a for asset - - // number: 'int64', - // string: 'string' - // } - - // const value = data[key] - // const type = valueTypes[typeof value] - - // return { - // key: camelToSnakeCase(key), - // value: [type, value] - // } - // }) + return { + key: camelToSnakeCase(key), + value: [type, value] + } + }) } } // ...(alerts.created.length > 0