diff --git a/components.d.ts b/components.d.ts index 074ebb5..594c4ba 100644 --- a/components.d.ts +++ b/components.d.ts @@ -13,9 +13,10 @@ declare module 'vue' { CreateActionsSection: typeof import('./src/components/create/CreateActionsSection.vue')['default'] CreateDeliverySection: typeof import('./src/components/create/CreateMessageDeliveryMethodSection.vue')['default'] CreateMessageDeliveryMethodSection: typeof import('./src/components/create/CreateMessageDeliveryMethodSection.vue')['default'] - CreateMessagesSection: typeof import('./src/components/create/CreateMessagesSection.vue')['default'] + CreateMessagesSection: typeof import('./src/components/create/CreatePredefinedMessagesSection.vue')['default'] CreateNameSection: typeof import('./src/components/create/CreateNameSection.vue')['default'] CreatePlacementSection: typeof import('./src/components/create/CreatePlacementSection.vue')['default'] + CreatePredefinedMessagesSection: typeof import('./src/components/create/CreatePredefinedMessagesSection.vue')['default'] CreateReadySection: typeof import('./src/components/create/CreateReadySection.vue')['default'] CreateSection: typeof import('./src/components/create/CreateSection.vue')['default'] CreateSummarySection: typeof import('./src/components/create/CreateSummarySection.vue')['default'] diff --git a/src/api/qrCode.ts b/src/api/qrCode.ts index 0f715e4..ef4ecd8 100644 --- a/src/api/qrCode.ts +++ b/src/api/qrCode.ts @@ -10,7 +10,7 @@ export const createQrCodeDocument = async ( | 'placement' | 'actions' //| 'user_uuid' - | 'predefinedMessage' + | 'predefinedMessages' | 'messageDeliveryMethod' >, ) => { diff --git a/src/components/create/CreateMessagesSection.vue b/src/components/create/CreatePredefinedMessagesSection.vue similarity index 93% rename from src/components/create/CreateMessagesSection.vue rename to src/components/create/CreatePredefinedMessagesSection.vue index 8c17e85..11fceeb 100644 --- a/src/components/create/CreateMessagesSection.vue +++ b/src/components/create/CreatePredefinedMessagesSection.vue @@ -59,7 +59,7 @@ const defaultMessages = { } // Локальное хранилище сообщений -const messages = defineModel>({ +const messages = defineModel>({ required: true, }) @@ -67,11 +67,13 @@ const messages = defineModel props.placement, (newPlacement, previousPlacement) => { - let prevDefaultMessages: QRCodeDocument['predefinedMessage'] = [] + let prevDefaultMessages: QRCodeDocument['predefinedMessages'] = [] if (previousPlacement && previousPlacement in defaultMessages) { prevDefaultMessages = defaultMessages[previousPlacement] } - const isMessagesDefault = JSON.stringify(messages.value) === JSON.stringify(prevDefaultMessages) + const isMessagesDefault = + messages.value.length === 0 || + JSON.stringify(messages.value) === JSON.stringify(prevDefaultMessages) if (isMessagesDefault) { messages.value = [...(defaultMessages[newPlacement] || [])] } diff --git a/src/components/create/CreateSummarySection.vue b/src/components/create/CreateSummarySection.vue index 5f6a20f..e290750 100644 --- a/src/components/create/CreateSummarySection.vue +++ b/src/components/create/CreateSummarySection.vue @@ -3,57 +3,19 @@

Введите название для вашего QR‑кода

Название поможет вам организовать ваши QR‑коды.

-
+

Название обязательно.

-