import encryption from '../encryption/encryption';
export default {

    createParams(params){

        console.log({
            ...params,
            query:{
                ...params.query,
                u: encryption.encode(JSON.stringify(params.params))
            },
            params: params.temporaryParams
        });

        return {
            ...params,
            query:{
                ...params.query,
                u: encryption.encode(JSON.stringify(params.params))
            },
            params: params.temporaryParams
        }

    },

    decodeParams(u){
        try {
            return  JSON.parse(encryption.decode(u));
        } catch (e) {
            return {};
        }
    }

}