Skip to content

Commit

Permalink
(Dressca)Open API 仕様書の更新に追従する (#1721)
Browse files Browse the repository at this point in the history
* OpenAPI 仕様書の相対パスを修正

* Consumer の API クライアントを再生成

* consumerのmockをmaia-maris間で共通化

* Admin の API クライアントを再生成

* Adminのフロントエンドのコードを最新と同期
  • Loading branch information
KentaHizume authored Dec 20, 2024
1 parent 1c60362 commit 06347c8
Show file tree
Hide file tree
Showing 24 changed files with 239 additions and 183 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type {
CatalogItemResponse,
PagedListOfCatalogItemResponse,
GetCatalogItemResponse,
PagedListOfGetCatalogItemResponse,
} from '@/generated/api-client';

export const catalogItems: CatalogItemResponse[] = [
export const catalogItems: GetCatalogItemResponse[] = [
{
id: 1,
catalogCategoryId: 1,
Expand Down Expand Up @@ -129,7 +129,7 @@ export const catalogItems: CatalogItemResponse[] = [
},
];

export const pagedListCatalogItem: PagedListOfCatalogItemResponse = {
export const pagedListCatalogItem: PagedListOfGetCatalogItemResponse = {
hasNext: false,
hasPrevious: false,
page: 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { CatalogBrandResponse } from '@/generated/api-client';
import type { GetCatalogBrandsResponse } from '@/generated/api-client';
import { HttpResponse, http } from 'msw';

const catalogBrands: CatalogBrandResponse[] = [
const catalogBrands: GetCatalogBrandsResponse[] = [
{
id: 1,
name: '高級なブランド',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { CatalogCategoryResponse } from '@/generated/api-client';
import type { GetCatalogCategoriesResponse } from '@/generated/api-client';
import { HttpResponse, http } from 'msw';

const catalogCategories: CatalogCategoryResponse[] = [
const catalogCategories: GetCatalogCategoriesResponse[] = [
{
id: 1,
name: '服',
Expand Down
6 changes: 3 additions & 3 deletions samples/web-csr/dressca-frontend/admin/mock/handlers/users.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { HttpResponse, http } from 'msw';
import type { UserResponse } from '@/generated/api-client';
import type { GetLoginUserResponse } from '@/generated/api-client';

const user: UserResponse = {
const user: GetLoginUserResponse = {
userName: '[email protected]',
role: 'Admin',
roles: ['Admin'],
};

export const usersHandlers = [
Expand Down
4 changes: 2 additions & 2 deletions samples/web-csr/dressca-frontend/admin/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ref } from 'vue';
const router = useRouter();
const authenticationStore = useAuthenticationStore();
const { authenticationState, userName, userRole } =
const { authenticationState, userName, userRoles } =
storeToRefs(authenticationStore);
/**
Expand Down Expand Up @@ -56,7 +56,7 @@ const logout = async () => {
>
<div class="relative rounded-full text-white">
<span class="absolute -inset-1.5"></span>
{{ userRole }}
{{ userRoles }}
</div>
<div
class="absolute inset-y-0 right-0 flex items-center pr-2 sm:static sm:inset-auto sm:ml-6 sm:pr-0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ common.ts
configuration.ts
git_push.sh
index.ts
models/catalog-brand-response.ts
models/catalog-category-response.ts
models/catalog-item-response.ts
models/get-catalog-brands-response.ts
models/get-catalog-categories-response.ts
models/get-catalog-item-response.ts
models/get-login-user-response.ts
models/index.ts
models/link.ts
models/paged-list-of-catalog-item-response.ts
models/paged-list-of-get-catalog-item-response.ts
models/post-catalog-item-request.ts
models/put-catalog-item-request.ts
models/user-response.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import type { CatalogBrandResponse } from '../models';
import type { GetCatalogBrandsResponse } from '../models';
/**
* CatalogBrandsApi - axios parameter creator
* @export
Expand Down Expand Up @@ -75,7 +75,7 @@ export const CatalogBrandsApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getCatalogBrands(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<CatalogBrandResponse>>> {
async getCatalogBrands(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<GetCatalogBrandsResponse>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getCatalogBrands(options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['CatalogBrandsApi.getCatalogBrands']?.[localVarOperationServerIndex]?.url;
Expand All @@ -97,7 +97,7 @@ export const CatalogBrandsApiFactory = function (configuration?: Configuration,
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCatalogBrands(options?: RawAxiosRequestConfig): AxiosPromise<Array<CatalogBrandResponse>> {
getCatalogBrands(options?: RawAxiosRequestConfig): AxiosPromise<Array<GetCatalogBrandsResponse>> {
return localVarFp.getCatalogBrands(options).then((request) => request(axios, basePath));
},
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import type { CatalogCategoryResponse } from '../models';
import type { GetCatalogCategoriesResponse } from '../models';
/**
* CatalogCategoriesApi - axios parameter creator
* @export
Expand Down Expand Up @@ -75,7 +75,7 @@ export const CatalogCategoriesApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async getCatalogCategories(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<CatalogCategoryResponse>>> {
async getCatalogCategories(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<GetCatalogCategoriesResponse>>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.getCatalogCategories(options);
const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
const localVarOperationServerBasePath = operationServerMap['CatalogCategoriesApi.getCatalogCategories']?.[localVarOperationServerIndex]?.url;
Expand All @@ -97,7 +97,7 @@ export const CatalogCategoriesApiFactory = function (configuration?: Configurati
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
getCatalogCategories(options?: RawAxiosRequestConfig): AxiosPromise<Array<CatalogCategoryResponse>> {
getCatalogCategories(options?: RawAxiosRequestConfig): AxiosPromise<Array<GetCatalogCategoriesResponse>> {
return localVarFp.getCatalogCategories(options).then((request) => request(axios, basePath));
},
};
Expand Down
Loading

0 comments on commit 06347c8

Please sign in to comment.