Skip to content

Commit 8cb592a

Browse files
committed
pr suggestions
1 parent af124da commit 8cb592a

File tree

4 files changed

+7
-27
lines changed

4 files changed

+7
-27
lines changed

package-lock.json

Lines changed: 2 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/compass-data-modeling/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@
7272
"react": "^17.0.2",
7373
"react-redux": "^8.1.3",
7474
"redux": "^4.2.1",
75-
"redux-thunk": "^2.4.2",
76-
"zod": "^3.24.4"
75+
"redux-thunk": "^2.4.2"
7776
},
7877
"devDependencies": {
7978
"@mongodb-js/eslint-config-compass": "^1.3.8",

packages/compass-data-modeling/src/components/diagram-editor.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useCallback, useMemo, useState } from 'react';
1+
import React, { useMemo, useState } from 'react';
22
import { connect } from 'react-redux';
33
import type { DataModelingState } from '../store/reducer';
44
import { CodemirrorMultilineEditor } from '@mongodb-js/compass-editor';
@@ -133,7 +133,7 @@ const DiagramEditor: React.FunctionComponent<{
133133
}
134134
}, [applyInput]);
135135

136-
const applyPlaceholder = useCallback(
136+
const applyPlaceholder =
137137
(type: 'AddRelationship' | 'RemoveRelationship') => () => {
138138
let placeholder = {};
139139
switch (type) {
@@ -168,9 +168,7 @@ const DiagramEditor: React.FunctionComponent<{
168168
throw new Error(`Unknown placeholder ${placeholder}`);
169169
}
170170
setApplyInput(JSON.stringify(placeholder, null, 2));
171-
},
172-
[setApplyInput]
173-
);
171+
};
174172

175173
const modelStr = useMemo(() => {
176174
return JSON.stringify(model, null, 2);

packages/compass-data-modeling/src/services/data-model-storage.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { z } from '@mongodb-js/compass-user-data';
22
import type { MongoDBJSONSchema } from 'mongodb-schema';
3-
import type { ZodError } from 'zod';
43

54
export const RelationshipSideSchema = z.object({
65
ns: z.string(),
@@ -84,7 +83,7 @@ export const validateEdit = (
8483
} catch (e) {
8584
return {
8685
result: false,
87-
errors: (e as ZodError).issues.map(({ path, message }) =>
86+
errors: (e as z.ZodError).issues.map(({ path, message }) =>
8887
message === 'Required'
8988
? `'${path}' is required`
9089
: `Invalid field '${path}': ${message}`

0 commit comments

Comments
 (0)