refactor: 変数の名前を変更
This commit is contained in:
parent
0ee451af73
commit
5466f475d4
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue