Преглед изворни кода

Remove week property from DayPlan objects in DB. Remove unused imports

Tatiana Inama пре 7 година
родитељ
комит
c0951e2a01

+ 0 - 1
ktchn/src/planner/controller.ts

@@ -57,7 +57,6 @@ const getPlannerByRange: Controller<{from: Date, to: Date}, WeeklyPlanner> = db
     }
   ]).then(plans => plans.reduce((planner, plan) => {
     const date = moment(plan.date);
-    console.log(plan);
     return {
       ...planner,
       [getWeekDay(date)]: {

+ 0 - 1
ktchn/src/planner/model.ts

@@ -22,7 +22,6 @@ export type WeekPlan<T> = {
 
 export interface Plan {
   date: Date,
-  week: number,
   recipe: ObjectID,
   meal: Meal
 }

+ 1 - 2
recipes/src/containers/Planner/reducers.ts

@@ -2,8 +2,7 @@ import { PlannerActions } from './actions';
 import { PlannerState, DBPlanner, WeekPlan, Weekday } from 'types/planner';
 import { getWeekNumber, mkWeekDay } from 'services/time';
 import { Reducer } from 'redux';
-import { merge, uniqBy } from 'ramda';
-import moment from 'moment';
+import { merge } from 'ramda';
 
 const initialState: PlannerState = {
   mode: 'view',

+ 1 - 2
recipes/src/containers/Planner/services.ts

@@ -1,5 +1,5 @@
 import { shortDate } from 'services/time';
-import axios, { AxiosPromise } from 'axios';
+import axios from 'axios';
 import { DBPlanner, DBDayPlan, WeekPlan, Weekday, DayPlan, Meal } from 'types/planner';
 import moment, { Moment } from 'moment';
 
@@ -12,7 +12,6 @@ const toDBPlan = (weekplan: WeekPlan) => {
     const dish = day[meal];
     const date = moment(day.date);
     return dish ? [{
-      week: date.week(),
       recipe: dish._id,
       meal: meal,
       date: date.format()

+ 0 - 1
recipes/src/types/planner.ts

@@ -47,7 +47,6 @@ export interface PlannerState {
 export interface DBDayPlan {
   date: string,
   recipe: string,
-  week: number,
   meal: Meal
 }