Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CS-44364- Fixed the issue where the reference was coming in as string #1362

Merged
merged 5 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/contentstack-audit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-audit",
"version": "1.5.1",
"version": "1.5.2",
"description": "Contentstack audit plugin",
"author": "Contentstack CLI",
"homepage": "https://github.com/contentstack/cli",
Expand Down
10 changes: 10 additions & 0 deletions packages/contentstack-audit/src/modules/entries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,11 @@ export default class Entries {
fieldStructure: ReferenceFieldDataType,
field: EntryReferenceFieldDataType[],
) {
if (typeof field === 'string') {
let stringReference = field as string;
stringReference = stringReference.replace(/'/g, '"');
field = JSON.parse(stringReference);
}
return this.validateReferenceValues(tree, fieldStructure, field);
}

Expand Down Expand Up @@ -826,6 +831,11 @@ export default class Entries {
entry: EntryReferenceFieldDataType[],
) {
const missingRefs: Record<string, any>[] = [];
if (typeof entry === 'string') {
let stringReference = entry as string;
stringReference = stringReference.replace(/'/g, '"');
entry = JSON.parse(stringReference);
}
entry = entry
?.map((reference) => {
const { uid } = reference;
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-audit": "~1.5.1",
"@contentstack/cli-audit": "~1.5.2",
"@contentstack/cli-command": "~1.2.16",
"@contentstack/cli-utilities": "~1.6.0",
"@contentstack/management": "~1.15.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli",
"description": "Command-line tool (CLI) to interact with Contentstack",
"version": "1.17.0",
"version": "1.17.1",
"author": "Contentstack",
"bin": {
"csdx": "./bin/run"
Expand All @@ -22,7 +22,7 @@
"prepack": "pnpm compile && oclif manifest && oclif readme"
},
"dependencies": {
"@contentstack/cli-audit": "~1.5.1",
"@contentstack/cli-audit": "~1.5.2",
"@contentstack/cli-auth": "~1.3.17",
"@contentstack/cli-cm-bootstrap": "~1.9.0",
"@contentstack/cli-cm-branches": "~1.0.24",
Expand Down
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading