Skip to content

Commit f9e5990

Browse files
refactor: generate randomId in createDocument and createTemplate API
1 parent c115c7c commit f9e5990

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

apps/OpenSignServer/cloud/customRoute/v1/routes/createDocumentwithCoordinate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export default async function createDocumentwithCoordinate(request, response) {
119119
xPosition: widget.x,
120120
yPosition: widget.y,
121121
isStamp: widget.type === 'stamp',
122-
key: Math.floor(Math.random() * 10000),
122+
key: randomId(),
123123
isDrag: false,
124124
firstXPos: widget.x,
125125
firstYPos: widget.y,
@@ -147,7 +147,7 @@ export default async function createDocumentwithCoordinate(request, response) {
147147
signerObjId: signer?.contactPtr?.objectId,
148148
signerPtr: signer?.contactPtr,
149149
Role: signer.role,
150-
Id: 3000 + index * 1000,
150+
Id: randomId(),
151151
blockColor: color[signer?.index],
152152
placeHolder,
153153
};

apps/OpenSignServer/cloud/customRoute/v1/routes/createTemplatewithCoordinate.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export default async function createTemplatewithCoordinate(request, response) {
124124
xPosition: widget.x,
125125
yPosition: widget.y,
126126
isStamp: widget.type === 'stamp',
127-
key: Math.floor(Math.random() * 10000),
127+
key: randomId(),
128128
isDrag: false,
129129
firstXPos: widget.x,
130130
firstYPos: widget.y,
@@ -152,7 +152,7 @@ export default async function createTemplatewithCoordinate(request, response) {
152152
signerObjId: signer?.contactPtr?.objectId,
153153
signerPtr: signer?.contactPtr,
154154
Role: signer.role,
155-
Id: 3000 + index * 1000,
155+
Id: randomId(),
156156
blockColor: color[signer?.index],
157157
placeHolder,
158158
};

0 commit comments

Comments
 (0)