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

すべてのカテゴリ・ブランドを表すレコードを追加する処理をVIew・ViewModelに移動する #2178

Open
KentaHizume opened this issue Dec 26, 2024 · 0 comments
Labels
target: Dressca サンプルアプリケーションDresscaに関係がある

Comments

@KentaHizume
Copy link
Contributor

KentaHizume commented Dec 26, 2024

概要

Consumerではカタログストアのアクションで、
カテゴリとブランドについてデータをフェッチした後に{ id: 0, name: 'すべて' }のレコードを追加している。
これはセレクトボックスで「すべて」を選べるようにするためのUIの都合なので、
この処理についてはCatalogViewに移動したい。

現在のConsumerのカタログに関するつくりとして、
各ページでカタログストアで定義したStateを参照しているので、
このつくりをやめる必要がありそう。

詳細 / 機能詳細(オプション)

  • カタログストア
  actions: {
    async fetchCategories() {
      const response = await catalogCategoriesApi.getCatalogCategories();
      this.categories = response.data;
      this.categories.unshift({ id: 0, name: 'すべて' });
    },
  • カタログビュー
<label class="mr-2 font-bold"
  >カテゴリ
  <select v-model="selectedCategory" class="w-48 border-2">
    <option
      v-for="category in getCategories"
      :key="category.id"
      :value="category.id"
    >
      {{ category.name }}
    </option>
  </select>
</label>

完了条件

ここにこの Issue の完了条件を箇条書きで記載します。

@KentaHizume KentaHizume added the not triaged 精緻化、分析がされていない label Dec 26, 2024
@tsuna-can-se tsuna-can-se added target: Dressca サンプルアプリケーションDresscaに関係がある and removed not triaged 精緻化、分析がされていない labels Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target: Dressca サンプルアプリケーションDresscaに関係がある
Projects
None yet
Development

No branches or pull requests

2 participants