From 2b150c72ce85c2e92c94658ba107222b4c3939cb Mon Sep 17 00:00:00 2001 From: Akhil Date: Tue, 4 Oct 2022 18:17:13 +0530 Subject: [PATCH 1/3] Remove headers --- .gitlab-ci.yml | 7 +++++-- lib/Service/UserService.php | 6 +----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7ff508da..c39c8e99 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,7 @@ include: - - project: 'e/infra/ecloud/nextcloud-apps/ci-templates' + - project: "e/infra/ecloud/nextcloud-apps/ci-templates" ref: main - file: 'nc-apps-checkout-deploy.yml' + file: "nc-apps-lint-build-frontend.yml" + - project: "e/infra/ecloud/nextcloud-apps/ci-templates" + ref: main + file: "nc-apps-deploy.yml" diff --git a/lib/Service/UserService.php b/lib/Service/UserService.php index 057ebc02..70b991f8 100644 --- a/lib/Service/UserService.php +++ b/lib/Service/UserService.php @@ -131,12 +131,8 @@ class UserService 'uid' => $userID, 'email' => $email ]; - - $headers = array( - 'Content-Type: application/json' - ); - $answer = $this->curl->post($postDeleteUrl, $params, $headers); + $answer = $this->curl->post($postDeleteUrl, $params); return json_decode($answer, true); } catch (\Exception $e) { -- GitLab From 4fd396f90af3984d43dbbd3668472e98ef5ea62d Mon Sep 17 00:00:00 2001 From: Akhil Date: Tue, 4 Oct 2022 18:29:57 +0530 Subject: [PATCH 2/3] Disable initially --- src/delete-account-listeners.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/delete-account-listeners.js b/src/delete-account-listeners.js index 09b6c4f2..f4ccbd8c 100644 --- a/src/delete-account-listeners.js +++ b/src/delete-account-listeners.js @@ -1,5 +1,9 @@ /* global $ */ $(document).ready(function() { + // Disable initially + $('#drop_account_confirm').prop('disabled', true); + $('#deleteaccount').prop('disabled', true) + const elem = document.getElementById('body-settings') elem.addEventListener('disable-delete-account', function() { $('#deleteaccount').prop('disabled', true) -- GitLab From 6cb190402315f492b41889918e6bfe4b332f285e Mon Sep 17 00:00:00 2001 From: Akhil Date: Tue, 4 Oct 2022 18:35:56 +0530 Subject: [PATCH 3/3] lint fix --- package-lock.json | 1 - package.json | 1 - src/PersonalSettings.vue | 17 ++++++++--------- src/delete-account-listeners.js | 2 +- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/package-lock.json b/package-lock.json index 898bc155..c5df651b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,6 @@ "@nextcloud/password-confirmation": "^1.0.1", "@nextcloud/router": "^2.0.0", "@nextcloud/vue": "^5.4.0", - "lodash": "^4.17.21", "vue": "^2.7.8" }, "devDependencies": { diff --git a/package.json b/package.json index c220e461..a5515beb 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,6 @@ "@nextcloud/password-confirmation": "^1.0.1", "@nextcloud/router": "^2.0.0", "@nextcloud/vue": "^5.4.0", - "lodash": "^4.17.21", "vue": "^2.7.8" }, "browserslist": [ diff --git a/src/PersonalSettings.vue b/src/PersonalSettings.vue index 7916b0f3..9f2a1067 100644 --- a/src/PersonalSettings.vue +++ b/src/PersonalSettings.vue @@ -66,7 +66,6 @@ import SettingsSection from '@nextcloud/vue/dist/Components/SettingsSection.js' import Axios from '@nextcloud/axios' import { generateUrl } from '@nextcloud/router' import { showError } from '@nextcloud/dialogs' -import { debounce } from 'lodash' export default { name: 'PersonalSettings', @@ -113,7 +112,7 @@ export default { this.enableDeleteAccountEvent() } }, - enableDeleteAccountEvent() { + enableDeleteAccountEvent() { const elem = document.getElementById('body-settings') const event = new Event('enable-delete-account') elem.dispatchEvent(event) @@ -166,14 +165,14 @@ export default { const { status, data } = await Axios.post(url, { shopEmailPostDelete: this.shopEmailPostDelete, }) - return { status, data} + return { status, data } } catch (err) { - return { status: err.response.status, data: err.response.data} + return { status: err.response.status, data: err.response.data } } }, - updateEmailPostDelete: async function(event) { - if(document.activeElement === event.target) { - return; + async updateEmailPostDelete(event) { + if (document.activeElement === event.target) { + return } if (this.shopEmailPostDelete === this.userEmail) { showError( @@ -183,13 +182,13 @@ export default { ) ) } else { - const { status, data} = await this.callAPIToUpdateEmail() + const { status, data } = await this.callAPIToUpdateEmail() if (status !== 200) { this.disableDeleteAccountEvent() showError( t( 'ecloud-accounts', - data['message'] + data.message ) ) } else { diff --git a/src/delete-account-listeners.js b/src/delete-account-listeners.js index f4ccbd8c..42046a3c 100644 --- a/src/delete-account-listeners.js +++ b/src/delete-account-listeners.js @@ -1,7 +1,7 @@ /* global $ */ $(document).ready(function() { // Disable initially - $('#drop_account_confirm').prop('disabled', true); + $('#drop_account_confirm').prop('disabled', true) $('#deleteaccount').prop('disabled', true) const elem = document.getElementById('body-settings') -- GitLab