bfg-common 1.5.784 → 1.5.785
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.
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
|
|
2
2
|
import type { API_UI_I_Error } from '~/lib/models/store/interfaces'
|
|
3
3
|
import type { UI_T_Project } from '~/lib/models/types'
|
|
4
|
-
import {
|
|
4
|
+
import { UI_E_ObjectNodeKind } from '~/lib/models/enums'
|
|
5
|
+
import { checkName } from '~/lib/utils/validation'
|
|
5
6
|
|
|
6
7
|
export const checkValidityName = async ({
|
|
7
8
|
name,
|
|
@@ -17,6 +18,16 @@ export const checkValidityName = async ({
|
|
|
17
18
|
datacenterId?: string
|
|
18
19
|
}): Promise<void> => {
|
|
19
20
|
wizard.setLoader(true)
|
|
21
|
+
|
|
22
|
+
const asd = checkName(
|
|
23
|
+
name,
|
|
24
|
+
project,
|
|
25
|
+
UI_E_ObjectNodeKind.DATASTORE,
|
|
26
|
+
datacenterId
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
console.log(asd, 'validate datastore name in vizard')
|
|
30
|
+
|
|
20
31
|
const url = buildValidationUrl(name, project, datacenterId)
|
|
21
32
|
|
|
22
33
|
const { error } = await useMyFetch<null, API_UI_I_Error>(url, {
|
|
@@ -45,7 +56,7 @@ const buildValidationUrl = (
|
|
|
45
56
|
|
|
46
57
|
const params = new URLSearchParams()
|
|
47
58
|
params.set('name', name)
|
|
48
|
-
params.set('kind', String(
|
|
59
|
+
params.set('kind', String(UI_E_ObjectNodeKind.DATASTORE))
|
|
49
60
|
if (datacenterId) params.set('datacenter', datacenterId)
|
|
50
61
|
|
|
51
62
|
return `/ui/object/validate_name_datacenter?${params.toString()}`
|
package/lib/utils/validation.ts
CHANGED