From 89a06059076c952f281b03b80b98f38098c861d3 Mon Sep 17 00:00:00 2001 From: Abhishek Ezhava Date: Tue, 30 Apr 2024 17:13:40 +0530 Subject: [PATCH] feat: handler for get variant by id --- src/stack/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/stack/index.ts b/src/stack/index.ts index d2155b9..8ba38fd 100755 --- a/src/stack/index.ts +++ b/src/stack/index.ts @@ -296,6 +296,17 @@ class Stack { const options = { params: optionParams, action: 'getVariantGroups' }; return this._connection.sendToParent('stackQuery', options).then(onData).catch(onError); } + + /** + * Returns variant groups details. + * @returns variant groups details. + */ + getVariantById(query={}, params = {}) { + const optionParams: GenericObjectType = params; + optionParams.query = query; + const options = { params: optionParams, action: 'getVariantById' }; + return this._connection.sendToParent('stackQuery', options).then(onData).catch(onError); + } } export default Stack;