refactor(frontend): 非推奨となったReactivity Transformを使わないように (#12539)
* refactor(frontend): 非推奨となったReactivity Transformを使わないように * refactor: 不要な括弧を除去 * fix: 不要なアノテーションを除去 * fix: Refの配列をrefしている部分の対応 * refactor: 不要な括弧を除去 * fix: lint * refactor: Ref、ShallowRef、ComputedRefの変数の宣言をletからconstに置換 * fix: type error * chore: drop reactivity transform from eslint configuration * refactor: remove unnecessary import * fix: 対応漏れ
This commit is contained in:
@@ -22,7 +22,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from 'vue';
|
||||
import { computed, ref } from 'vue';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import XHeader from './_header_.vue';
|
||||
import XEditor from './roles.editor.vue';
|
||||
@@ -39,17 +39,17 @@ const props = defineProps<{
|
||||
id?: string;
|
||||
}>();
|
||||
|
||||
let role = $ref(null);
|
||||
let data = $ref(null);
|
||||
const role = ref(null);
|
||||
const data = ref(null);
|
||||
|
||||
if (props.id) {
|
||||
role = await os.api('admin/roles/show', {
|
||||
role.value = await os.api('admin/roles/show', {
|
||||
roleId: props.id,
|
||||
});
|
||||
|
||||
data = role;
|
||||
data.value = role.value;
|
||||
} else {
|
||||
data = {
|
||||
data.value = {
|
||||
name: 'New Role',
|
||||
description: '',
|
||||
isAdministrator: false,
|
||||
@@ -69,24 +69,24 @@ if (props.id) {
|
||||
|
||||
async function save() {
|
||||
rolesCache.delete();
|
||||
if (role) {
|
||||
if (role.value) {
|
||||
os.apiWithDialog('admin/roles/update', {
|
||||
roleId: role.id,
|
||||
...data,
|
||||
roleId: role.value.id,
|
||||
...data.value,
|
||||
});
|
||||
router.push('/admin/roles/' + role.id);
|
||||
router.push('/admin/roles/' + role.value.id);
|
||||
} else {
|
||||
const created = await os.apiWithDialog('admin/roles/create', {
|
||||
...data,
|
||||
...data.value,
|
||||
});
|
||||
router.push('/admin/roles/' + created.id);
|
||||
}
|
||||
}
|
||||
|
||||
const headerTabs = $computed(() => []);
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata(computed(() => role ? {
|
||||
title: i18n.ts._role.edit + ': ' + role.name,
|
||||
definePageMetadata(computed(() => role.value ? {
|
||||
title: i18n.ts._role.edit + ': ' + role.value.name,
|
||||
icon: 'ti ti-badge',
|
||||
} : {
|
||||
title: i18n.ts._role.new,
|
||||
|
Reference in New Issue
Block a user