From 677106a58bfb327f807b75aa6216cdb77648dc67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Wed, 5 May 2021 18:41:16 +0200 Subject: [PATCH] lint fix --- packages/builder/src/stores/portal/index.js | 2 +- .../builder/src/stores/portal/organisation.js | 58 +++++++++---------- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/packages/builder/src/stores/portal/index.js b/packages/builder/src/stores/portal/index.js index 7953ae16cb..885bb1680a 100644 --- a/packages/builder/src/stores/portal/index.js +++ b/packages/builder/src/stores/portal/index.js @@ -1 +1 @@ -export { organisation } from "./organisation" \ No newline at end of file +export { organisation } from "./organisation" diff --git a/packages/builder/src/stores/portal/organisation.js b/packages/builder/src/stores/portal/organisation.js index bef899d186..7926121ea3 100644 --- a/packages/builder/src/stores/portal/organisation.js +++ b/packages/builder/src/stores/portal/organisation.js @@ -2,36 +2,36 @@ import { writable } from "svelte/store" import api from "builderStore/api" export function createOrganisationStore() { - const { subscribe, set } = writable({}) + const { subscribe, set } = writable({}) - async function init() { - try { - const response = await api.get(`/api/admin/configs/settings`) - const json = await response.json() - set(json) - } catch (error) { - set({ - platformUrl: '', - logoUrl: '', - docsUrl: '', - company: '' - }) - } - } - - return { - subscribe, - save: async config => { - try { - await api.post('/api/admin/configs', { type: 'settings', config}) - await init() - return { status: 200 } - } catch (error) { - return { error } - } - }, - init + async function init() { + try { + const response = await api.get(`/api/admin/configs/settings`) + const json = await response.json() + set(json) + } catch (error) { + set({ + platformUrl: "", + logoUrl: "", + docsUrl: "", + company: "", + }) } } -export const organisation = createOrganisationStore() \ No newline at end of file + return { + subscribe, + save: async config => { + try { + await api.post("/api/admin/configs", { type: "settings", config }) + await init() + return { status: 200 } + } catch (error) { + return { error } + } + }, + init, + } +} + +export const organisation = createOrganisationStore()