forked from potsda.mn/mobilizon
Fix admin settings
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
a0eb880f6a
commit
ff5e27b0a0
|
@ -105,7 +105,7 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Component, Vue } from "vue-property-decorator";
|
import { Component, Vue } from "vue-property-decorator";
|
||||||
import { ADMIN_SETTINGS, SAVE_ADMIN_SETTINGS } from "@/graphql/admin";
|
import { ADMIN_SETTINGS, SAVE_ADMIN_SETTINGS } from "@/graphql/admin";
|
||||||
import { IAdminSettings, InstanceTermsType } from "@/types/admin.model";
|
import { IAdminSettings, InstanceTermsType } from "../../types/admin.model";
|
||||||
import RouteName from "../../router/name";
|
import RouteName from "../../router/name";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
|
|
|
@ -157,7 +157,15 @@ defmodule Mobilizon.GraphQL.Resolvers.Admin do
|
||||||
when is_admin(role) do
|
when is_admin(role) do
|
||||||
with {:ok, res} <- Admin.save_settings("instance", args) do
|
with {:ok, res} <- Admin.save_settings("instance", args) do
|
||||||
res =
|
res =
|
||||||
res |> Enum.map(fn {key, %Setting{value: value}} -> {key, value} end) |> Enum.into(%{})
|
res
|
||||||
|
|> Enum.map(fn {key, %Setting{value: value}} ->
|
||||||
|
case value do
|
||||||
|
"true" -> {key, true}
|
||||||
|
"false" -> {key, false}
|
||||||
|
value -> {key, value}
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|> Enum.into(%{})
|
||||||
|
|
||||||
Config.clear_config_cache()
|
Config.clear_config_cache()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue