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

[FE] 체크리스트 put을 V1으로 마이그레이션한다. #897

Merged
merged 9 commits into from
Oct 24, 2024
2 changes: 1 addition & 1 deletion frontend/src/apis/checklist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const postChecklist = async (checklist: ChecklistPostForm) => {
export const putChecklist = async (id: number, checklist: ChecklistPostForm) => {
const mappedRoomInfo = roomInfoApiMapper(checklist.room);
const mappedChecklist = { ...checklist, room: mappedRoomInfo };
const response = await fetcher.put({ url: BASE_URL + ENDPOINT.CHECKLIST_ID(id), body: mappedChecklist });
const response = await fetcher.put({ url: BASE_URL + ENDPOINT.CHECKLIST_ID_V1(id), body: mappedChecklist });
return response;
};

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/hooks/useRoomInfoValidated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const validators: Record<keyof ValidatedRoomInfo, Validator[]> = {
deposit: [isNumericValidator, nonNegativeValidator],
rent: [isNumericValidator, nonNegativeValidator],
maintenanceFee: [isNumericValidator, nonNegativeValidator],
contractTerm: [isNumericValidator, nonNegativeValidator],
contractTerm: [isNumericValidator, nonNegativeValidator, inRangeValidator(0, 10000)],
type: [],
size: [isNumericValidator],
floor: [isIntegerValidator, positiveValidator],
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/hooks/useTabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const useTabs = () => {
const getTabs = (categories: Category[]) => {
return categories.map(category => ({
id: category.categoryId,
name: category.categoryName as string,
name: category.categoryName,
className: findCategoryClassNameByName(category.categoryName),
})) as Tab[];
};
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/store/roomInfoStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ export const roomInfoApiMapper = (values: Partial<RoomInfoStoreState>) => {
occupancyMonth: values.occupancyMonth === 0 ? undefined : values.occupancyMonth,
};

return mapObjUndefinedToNull(result) as Nullable<Partial<RoomInfoStoreState>>;
const { station: _, ...resultToSubmit } = result;

return mapObjUndefinedToNull(resultToSubmit) as Nullable<Partial<RoomInfoStoreState>>;
};

export default roomInfoStore;
5 changes: 0 additions & 5 deletions frontend/src/types/category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,3 @@ export interface Category {
categoryId: number;
categoryName: CategoryName;
}

// TODO: 방비교 추후를 위해..
// export interface CategoryScore extends Category {
// score?: number;
// }
Loading