There was a chance or URL overlap - removing this chance.

This commit is contained in:
mike12345567 2023-06-20 09:56:58 +01:00
parent 82bafacd72
commit b712136a6b
1 changed files with 8 additions and 4 deletions

View File

@ -1,19 +1,23 @@
import { generator } from "../../shared" import { generator } from "../../shared"
import { CreateAppRequest } from "../../types" import { CreateAppRequest } from "../../types"
function uniqueWord() {
return generator.word() + generator.hash()
}
export const generateApp = ( export const generateApp = (
overrides: Partial<CreateAppRequest> = {} overrides: Partial<CreateAppRequest> = {}
): CreateAppRequest => ({ ): CreateAppRequest => ({
name: generator.word() + generator.hash(), name: uniqueWord(),
url: `/${generator.word() + generator.hash()}`, url: `/${uniqueWord()}`,
...overrides, ...overrides,
}) })
// Applications type doesn't work here, save to add useTemplate parameter? // Applications type doesn't work here, save to add useTemplate parameter?
export const appFromTemplate = (): CreateAppRequest => { export const appFromTemplate = (): CreateAppRequest => {
return { return {
name: generator.word(), name: uniqueWord(),
url: `/${generator.word()}`, url: `/${uniqueWord()}`,
// @ts-ignore // @ts-ignore
useTemplate: "true", useTemplate: "true",
templateName: "Near Miss Register", templateName: "Near Miss Register",