refactor: 変数の名前を変更

This commit is contained in:
Chocolate Pie 2023-07-05 08:14:25 +09:00
parent 0ee451af73
commit 5466f475d4
2 changed files with 6 additions and 6 deletions

View File

@ -56,7 +56,7 @@ const props = defineProps<{
expiresAt: string;
forward: boolean;
expirationDate: string;
beforeExpiresAt?: string;
previousExpiresAt?: string;
}
editable: boolean;
data?: {
@ -67,7 +67,7 @@ const props = defineProps<{
expirationDate: string | null;
expiresAt: string;
forward: boolean;
beforeExpiresAt?: string;
previousExpiresAt?: string;
}
}>();
let expirationDate: string | null = $ref(null);
@ -88,7 +88,7 @@ const value = computed({
expirationDate: null,
expiresAt: 'indefinitely',
forward: false,
beforeExpiresAt: undefined,
previousExpiresAt: undefined,
};
for (const [key, _value] of Object.entries(data)) {
if (_value === null) {
@ -123,7 +123,7 @@ watch(() => value.value.expirationDate, () => renderExpirationDate(), { immediat
watch(() => value.value.expiresAt, () => renderExpirationDate(true));
watch(() => props.editable, () => {
if (props.editable) {
value.value.beforeExpiresAt = value.value.expiresAt;
value.value.previousExpiresAt = value.value.expiresAt;
}
});

View File

@ -123,7 +123,7 @@ let editingResolver = $ref<{
expiresAt: string;
expirationDate: string;
forward: boolean;
beforeExpiresAt?: string;
previousExpiresAt?: string;
}>(defaultResolver);
const pagination = {
@ -156,7 +156,7 @@ function save(): void {
targetUserPattern: editingResolver.targetUserPattern || null,
reporterPattern: editingResolver.reporterPattern || null,
reportContentPattern: editingResolver.reportContentPattern || null,
...(editingResolver.beforeExpiresAt && editingResolver.beforeExpiresAt === editingResolver.expiresAt ? {} : {
...(editingResolver.previousExpiresAt && editingResolver.previousExpiresAt === editingResolver.expiresAt ? {} : {
expiresAt: editingResolver.expiresAt,
}),
forward: editingResolver.forward,