mirror of
https://github.com/n8n-io/n8n.git
synced 2024-11-14 16:44:07 -08:00
🎨 Rename helper function
This commit is contained in:
parent
baf28dd216
commit
2c8e70f25f
|
@ -514,7 +514,7 @@ class App {
|
|||
where: { id: In(tagIds) },
|
||||
});
|
||||
|
||||
result.tags = TagHelpers.stringifyId(found);
|
||||
result.tags = TagHelpers.getTagsResponse(found);
|
||||
}
|
||||
|
||||
// Convert to response format in which the id is a string
|
||||
|
@ -566,7 +566,7 @@ class App {
|
|||
const results = await Db.collections.Workflow!.find(findQuery);
|
||||
results.forEach(workflow => {
|
||||
if (workflow.tags) {
|
||||
workflow.tags = TagHelpers.stringifyId(workflow.tags);
|
||||
workflow.tags = TagHelpers.getTagsResponse(workflow.tags);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -682,7 +682,7 @@ class App {
|
|||
where: { id: In(tagIds) },
|
||||
});
|
||||
|
||||
responseData.tags = TagHelpers.stringifyId(found);
|
||||
responseData.tags = TagHelpers.getTagsResponse(found);
|
||||
}
|
||||
|
||||
// Convert to response format in which the id is a string
|
||||
|
|
|
@ -25,7 +25,7 @@ function isStringArray(tags: unknown[]): tags is string[] {
|
|||
* Stringify the ID in every `ITagDb` in an array.
|
||||
* Side effect: Remove `createdAt` and `updatedAt` for a slimmer response.
|
||||
*/
|
||||
export function stringifyId(tags: ITagDb[]) {
|
||||
export function getTagsResponse(tags: ITagDb[]) {
|
||||
return tags.map(({ id, name }) => ({ id: id.toString(), name }));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue