richardcrng / riduce

Get rid of your reducer boilerplate! Zero hassle state management that's typed, flexible and scalable.
https://richardng.notion.site/Riduce-3cb629505a8d49279fe8848e1d564deb
15 stars 0 forks source link

actions.process.fields[column].constraints.create.push is not a function #15

Closed arezki1990 closed 3 years ago

arezki1990 commented 3 years ago

i am trying to push an element to a nested array in object ,it tells me it doesn't find push function

richardcrng commented 3 years ago

Can you share with me your initialState that you're passing to riduce? I'll try to reproduce!

arezki1990 commented 3 years ago

hello , this is my init state the problem is with 'process', i downgraded to redux-leaves and it works

export const initialState ={ /* ici on stocke tout les états partagés des obj*/
workSpaceList: [],
sourceList: [{ "id": 1, "dataSource": "CSV", "name": "source test", "tableName": "table_name", "path": "s3a://test/test.csv", "sparkOptionsJson": "", "sourceEnvironment": "HDFS", "nbLinesDataset": 0, "dateUpdate": 1603113151000, "dateCreate": 1603113151000 }],
sourceCredentialList: [],
planificationList: [],
processListByW: [],
resultQuality: [],
environment: "DEV",
headerSecurity: '',
selectedWorkSpace: {},
process: {
        name: "",
        engine_type: "",
        workspace: "",
        sourceId: "",
        environment: "DEV",
        type_process: "",
        default_priority: "",
        fields: [{
                constraints:[{
                        name: "",
                        additionalInfo: "",
                        id: "",
                        priorityLevel: 1,
                        state: "",
                        errorCost: 1.0
                    }]
        }

        ]

},
processPlanHistory: [{ "id": 2, "planification": { "id": 4, "processusId": 1, "periodicity": "DAY", "dayNumber": 0, "startTime": "17:45", "priorityConstraint": "HIGH", "retrieveSample": false, "powerExecution": null }, "dateExecution": 1606927500000, "statusExecution": "EXECUTED", "powerAsString": "null" }, { "id": 3, "planification": { "id": 5, "processusId": 1, "periodicity": "DAY", "dayNumber": 0, "startTime": "17:48", "priorityConstraint": "HIGH", "retrieveSample": false, "powerExecution": null }, "dateExecution": 1606927680000, "statusExecution": "EXECUTED", "powerAsString": "null" }],
currentUser: {},
isLoggedIn: true,
constraintsList: {
        NOT_NULL: false,
        UNIQUE: false,
        MAX_LENGTH: true,
        MAX_VALUE: true,
        MIN_VALUE: true,
        MIN_LENGTH: true,
        DATE_FORMAT: true,
        REGEX: true,
        NUMBER: false,
        STARTWITH: true,
        COMPARE: true,
        TOUPPER: false,
        EMAIL: true,
        PHONE: true,
        STATS: true,
        ZSCORE: false,
        IQR: true,
        LEVENSHTEIN: true,
        SOUNDEX: true,
        LIST: true,
},
dataTypes: [
        "DOUBLE",
        "LONG",
        "FLOAT",
        "STRING",
        "BOOLEAN",
        "DATE",
        "TIMESTAMP",
        "DECIMAL",
        "INTEGER",
        "STRUCT"
],

}
richardcrng commented 3 years ago

I might have fixed this in v0.0.11 - can you check?

arezki1990 commented 3 years ago

i checked it out and it works thanks for your commitment ;)

richardcrng commented 3 years ago

Thank you for using, trying and giving feedback! :)