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 { UI_E_Kind } from '~/lib/models/enums'
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(UI_E_Kind.STORAGE_VALIDATION_NAME))
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()}`
@@ -28,7 +28,7 @@ import { UI_E_ObjectNodeKind } from '~/lib/models/enums'
28
28
  // onHide()
29
29
  // }
30
30
 
31
- const checkName = async (
31
+ export const checkName = async (
32
32
  name: string,
33
33
  project: UI_T_Project,
34
34
  kind?: UI_E_ObjectNodeKind,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.784",
4
+ "version": "1.5.785",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",