@dev.smartpricing/message-composer-layer 1.0.15 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,6 +4,7 @@ import { isEmail } from '@dev.smartpricing/message-composer-utils/utils'
|
|
|
4
4
|
import { useQuery } from '@pinia/colada'
|
|
5
5
|
import { useSendTestEmailMutation } from '~/queries'
|
|
6
6
|
import { messageGroupsApi, messagesApi } from '~/api'
|
|
7
|
+
import { useEmailEditorStore } from '~/stores/emailEditor'
|
|
7
8
|
import { z } from 'zod'
|
|
8
9
|
|
|
9
10
|
defineOptions({
|
|
@@ -15,6 +16,7 @@ const props = defineProps<{
|
|
|
15
16
|
messageId?: string
|
|
16
17
|
messageGroupId?: string
|
|
17
18
|
language?: string
|
|
19
|
+
brandId?: string | null
|
|
18
20
|
}>()
|
|
19
21
|
|
|
20
22
|
const emit = defineEmits<{
|
|
@@ -80,6 +82,7 @@ const isResolvingMessage = computed(
|
|
|
80
82
|
|
|
81
83
|
const { t } = useI18n()
|
|
82
84
|
const toast = useToast()
|
|
85
|
+
const emailEditorStore = useEmailEditorStore()
|
|
83
86
|
const { mutate: sendTest, isLoading: isSending, status } = useSendTestEmailMutation()
|
|
84
87
|
|
|
85
88
|
const state = ref<Schema>({
|
|
@@ -104,11 +107,14 @@ const schema = z.object({
|
|
|
104
107
|
|
|
105
108
|
type Schema = z.output<typeof schema>
|
|
106
109
|
|
|
110
|
+
const resolvedBrandId = computed(() => props.brandId ?? messageGroup.value?.brand_id ?? emailEditorStore.brandId)
|
|
111
|
+
|
|
107
112
|
function onSubmit() {
|
|
108
113
|
if (!resolvedMessage.value) return
|
|
109
114
|
sendTest({
|
|
110
115
|
message: resolvedMessage.value,
|
|
111
116
|
to: state.value.to,
|
|
117
|
+
brand_id: resolvedBrandId.value,
|
|
112
118
|
})
|
|
113
119
|
}
|
|
114
120
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dev.smartpricing/message-composer-layer",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./nuxt.config.ts",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"vue-router": "^5.0.6",
|
|
40
40
|
"vue3-emoji-picker": "^1.1.8",
|
|
41
41
|
"zod": "^4.4.1",
|
|
42
|
-
"@dev.smartpricing/message-composer-utils": "3.1.
|
|
42
|
+
"@dev.smartpricing/message-composer-utils": "3.1.17"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@nuxt/eslint": "^1.15.2",
|