diff --git a/CHANGELOG.md b/CHANGELOG.md index 72c103d..5d2b17f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Force setProfile to use a valid cost center - Increase timeout to 60 seconds +## [1.44.7] - 2024-09-25 + +### Fixed +- Remove unnecessary b2b_users storage on vbase + ## [1.44.6] - 2024-09-05 ### Fixed diff --git a/manifest.json b/manifest.json index d84361e..948f22c 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "name": "storefront-permissions", "vendor": "vtex", - "version": "1.44.6", + "version": "1.44.7", "title": "Storefront Permissions", "description": "Manage User's permissions on apps that relates to this app", "mustUpdateAt": "2022-08-28", diff --git a/node/package.json b/node/package.json index 7f93c3d..4884491 100644 --- a/node/package.json +++ b/node/package.json @@ -1,6 +1,6 @@ { "name": "vtex.checkout-ui-custom", - "version": "1.44.6", + "version": "1.44.7", "dependencies": { "@vtex/api": "6.47.0", "atob": "^2.1.2", diff --git a/node/resolvers/Mutations/Users.ts b/node/resolvers/Mutations/Users.ts index 3115834..2323237 100644 --- a/node/resolvers/Mutations/Users.ts +++ b/node/resolvers/Mutations/Users.ts @@ -116,7 +116,7 @@ const updateUserFields = async ({ masterdata, fields, id }: any) => { return DocumentId } -const createPermission = async ({ masterdata, vbase, params }: any) => { +const createPermission = async ({ masterdata, params }: any) => { const { roleId, canImpersonate, @@ -129,7 +129,7 @@ const createPermission = async ({ masterdata, vbase, params }: any) => { id, } = params - const { DocumentId } = await masterdata + await masterdata .createOrUpdateEntireDocument({ dataEntity: config.name, fields: { @@ -157,25 +157,11 @@ const createPermission = async ({ masterdata, vbase, params }: any) => { throw error }) - - if (DocumentId) { - await vbase.saveJSON('b2b_users', email, { - canImpersonate, - clId, - costId, - email, - id: DocumentId, - name, - orgId, - roleId, - userId, - }) - } } export const addUser = async (_: any, params: any, ctx: Context) => { const { - clients: { masterdata, lm, vbase }, + clients: { masterdata, lm }, vtex: { logger }, } = ctx @@ -221,7 +207,6 @@ export const addUser = async (_: any, params: any, ctx: Context) => { ...params, clId: cId, }, - vbase, }) return { status: 'success', message: '', id: cId } @@ -237,7 +222,7 @@ export const addUser = async (_: any, params: any, ctx: Context) => { export const updateUser = async (_: any, params: any, ctx: Context) => { const { - clients: { masterdata, lm, vbase }, + clients: { masterdata, lm }, vtex: { logger }, } = ctx @@ -251,7 +236,6 @@ export const updateUser = async (_: any, params: any, ctx: Context) => { lm, masterdata, params, - vbase, }) return { status: 'success', message: '', id: params.clId } @@ -323,15 +307,13 @@ export const deleteUserProfile = async (_: any, params: any, ctx: Context) => { export const deleteUser = async (_: any, params: any, ctx: Context) => { const { - clients: { masterdata, vbase }, + clients: { masterdata }, vtex: { logger }, } = ctx - const { id, email } = params + const { id } = params try { - await vbase.deleteFile('b2b_users', email).catch(() => null) - await masterdata.deleteDocument({ dataEntity: config.name, id,