-
Notifications
You must be signed in to change notification settings - Fork 1
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
書籍のcopyrightを記入できるようにする #15
Conversation
<NavItem label="プロジェクト設定" /> | ||
<NavItem label="出版設定" /> | ||
<router-link :to="{ name: 'bookSetting', params: { id: presenter.book.identifier }}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
わかったことその1
このアプリ、URLにIDを持つのですが、そのIDが何であるかが場面によって勝手に変わる( restfulとかじゃないぽい )
で、BookRepositryはそのIDをもとにBookを生成するので、Bookを扱いたいときはidにbookのidentifierをわたしてあげる必要がある。
よくわからんままにbuildSettingのコードをコピって params: { id: presenter.projectTree.props.identifier }}"
とかするとbookがnullのままになってハマった。
@@ -6,6 +6,7 @@ export interface IBook { | |||
name: string; | |||
owner: string; | |||
genre?: number; | |||
copyright: string; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BookRepositoryやUsecaseはみんなBookEntityとIBookを元に型を定義しているから、ここにフィールドを追加したらstateにもcopyrightが追加されると思うのだけれど..何故かそうならない。どっか気づいていない謎メカニズムがあるぽいのだけれど、見つけられなくてもがいています
src/containers/BookSetting/index.vue
Outdated
}); | ||
|
||
const item = new BookEntity({ | ||
...this.presenter.Book, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここにフィールドを追加したらstateにもcopyrightが追加される ...
コード見た感じは僕もそう思います。
見当違いだったら申し訳ないんですけどもしかして小文字が○です?
this.presenter.Book
-> this.presenter.book
book: item ? new BookEntity(item).props : null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
あとは別の usecase 越しに store 更新されててそのへんが影響してるとか?
const bookEntity = BookEntity.newEntity({ name, owner, projectTreeRef }); |
手元で動いてないんでよくわかってないままコメントしてます。
見当違いだったらスルーしてください 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ほんとだ、Bookをbookにしたら治りました!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
動いたのでPushしました。ありがとうございます!
Origin
書籍のメタデータを記入できるようにする #1
現状
本を選んで、サイドバーから書籍設定を選ぶと

書籍設定画面ぽいものを作った
