diff --git a/core/lib/server/form.ts b/core/lib/server/form.ts index 9bbfd2afd..585d18f4c 100644 --- a/core/lib/server/form.ts +++ b/core/lib/server/form.ts @@ -7,7 +7,6 @@ import { defaultComponent } from "schemas"; import type { CommunitiesId, FormsId, PublicSchema, PubsId, PubTypesId, UsersId } from "db/public"; import { AuthTokenType, ElementType, InputComponent, StructuralFormElement } from "db/public"; -import { logger } from "logger"; import type { XOR } from "../types"; import type { GetPubTypesResult } from "./pubtype"; @@ -216,14 +215,7 @@ export const insertForm = ( isDefault: boolean, trx = db ) => { - logger.debug({ msg: "inserting form", pubType, name }); - const ranks = mudder.base62.mudder( - undefined, - undefined, - pubType.fields.length + 1, - undefined, - (pubType.fields.length + 1) * 20 - ); + const ranks = mudder.base62.mudder(pubType.fields.length + 1); return trx .with("form", (db) => diff --git a/core/lib/server/pub.ts b/core/lib/server/pub.ts index 9e2a877e1..d313821b7 100644 --- a/core/lib/server/pub.ts +++ b/core/lib/server/pub.ts @@ -1205,6 +1205,11 @@ export const updatePub = async ({ return result; }; +/** + * Adds an appropriate "rank" attribute to each related pub value passed in, based on the highest + * existing rank on the relevant pub. Returns all the pub values passed in. + */ + const getRankedValues = async ({ pubId, pubValues,