Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Fix rootStore import path for generate store model #345

Merged
merged 1 commit into from
May 28, 2020
Merged
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
2 changes: 1 addition & 1 deletion src/commands/generate/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const run = async function(toolbox: GluegunToolbox) {
if (name.endsWith("-store")) {
const rootStorePath = "./app/models/root-store/root-store.ts"
const rootStoreDef = 'export const RootStoreModel = types.model("RootStore").props({'
const storeTypeImport = `import { ${pascalName}Model } from "../../models/${name}"\n`
const storeTypeImport = `import { ${pascalName}Model } from "../${name}/${name}"\n`
const storeType = `\n ${camelName}: types.optional(${pascalName}Model, {}),`

await patching.prepend(rootStorePath, storeTypeImport)
Expand Down