Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 7783 | Rev 7789 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 7783 Rev 7788
Línea 77... Línea 77...
77
 
77
 
78
        axios.post(postUrl, currentFormData)
78
        axios.post(postUrl, currentFormData)
79
            .then(({ data }) => {
79
            .then(({ data }) => {
Línea 80... Línea 80...
80
                const newFeed = data.data;
80
                const newFeed = data.data;
81
 
81
 
82
                if (data.data.description || data.data.file || data.data.share_width) {
82
                /* if (data.data.description || data.data.file || data.data.share_width) {
83
                    return Object.entries(data.data).map(([key, value]) => {
83
                    return Object.entries(data.data).map(([key, value]) => {
84
                        setError(key, { type: "required", message: value })
84
                        setError(key, { type: "required", message: value })
Línea 85... Línea 85...
85
                    })
85
                    })
86
                }
86
                } */
87
 
87
 
88
                if (data.success) {
88
                if (data.success) {
Línea 122... Línea 122...
122
    const onUploadedHandler = (files) => {
122
    const onUploadedHandler = (files) => {
123
        setValue("file", files);
123
        setValue("file", files);
124
        clearErrors("file");
124
        clearErrors("file");
125
    };
125
    };
Línea -... Línea 126...
-
 
126
 
-
 
127
    if (loading) {
-
 
128
        return <Spinner />
-
 
129
    }
Línea 126... Línea 130...
126
 
130
 
127
 
131
 
128
    return (
132
    return (
129
        <Modal
133
        <Modal
Línea 134... Línea 138...
134
            <form encType="multipart/form-data" onSubmit={handleSubmit(onSubmit)}>
138
            <form encType="multipart/form-data" onSubmit={handleSubmit(onSubmit)}>
135
                <Modal.Header closeButton>
139
                <Modal.Header closeButton>
136
                    <Modal.Title>Compartir una publicación</Modal.Title>
140
                    <Modal.Title>Compartir una publicación</Modal.Title>
137
                </Modal.Header>
141
                </Modal.Header>
138
                <Modal.Body>
142
                <Modal.Body>
-
 
143
                    <DescriptionInput
-
 
144
                        name="description"
-
 
145
                        setValue={setValue}
-
 
146
                    />
-
 
147
                    {errors.description && <p>{errors.description.message}</p>}
139
                    {
148
                    {
140
                        loading
-
 
141
                            ?
-
 
142
                            <Spinner />
-
 
143
                            :
-
 
144
                            <>
-
 
145
                                <DescriptionInput
-
 
146
                                    name="description"
-
 
147
                                    setValue={setValue}
-
 
148
                                />
-
 
149
                                {
-
 
150
                                    modalType !== shareModalTypes.POST
149
                        modalType !== shareModalTypes.POST
151
                                    &&
150
                        &&
152
                                    <DropzoneComponent
151
                        <DropzoneComponent
153
                                        modalType={modalType}
152
                            modalType={modalType}
154
                                        onUploaded={onUploadedHandler}
153
                            onUploaded={onUploadedHandler}
155
                                        settedFile={getValues("file")}
154
                            settedFile={getValues("file")}
156
                                        recomendationText={recomendationText[modalType]}
155
                            recomendationText={recomendationText[modalType]}
157
                                    />
-
 
158
                                }
-
 
159
                            </>
156
                        />
160
                    }
157
                    }
161
                </Modal.Body>
158
                </Modal.Body>
162
                <Modal.Footer>
159
                <Modal.Footer>
163
                    <Button
160
                    <Button
164
                        size="sm"
161
                        size="sm"