Skip to content
This repository has been archived by the owner on Dec 23, 2023. It is now read-only.

Commit

Permalink
fix: added /api/ to byUrl and byFile
Browse files Browse the repository at this point in the history
Also removed several pieces of code that had I had commented out
  • Loading branch information
Jason Skipper committed Feb 24, 2022
1 parent 72b4913 commit 211c1f3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
2 changes: 1 addition & 1 deletion admin/src/components/Wysiwyg/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ WysiwygWithErrors.propTypes = {
onChange: PropTypes.func.isRequired,
placeholder: PropTypes.string,
resetProps: PropTypes.bool,
//style: PropTypes.object,
style: PropTypes.object,
tabIndex: PropTypes.string,
validations: PropTypes.object,
value: PropTypes.string,
Expand Down
4 changes: 2 additions & 2 deletions admin/src/components/editorjs/requiredTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ const requiredTools = {
"Authorization": `Bearer ${JSON.parse(sessionStorage.getItem("jwtToken"))}`
},
endpoints: {
byUrl: `/${PluginId}/image/byUrl`,
byUrl: `/api/${PluginId}/image/byUrl`,
},
uploader: {
async uploadByFile(file) {
const formData = new FormData();
formData.append("data", JSON.stringify({}));
formData.append("files.image", file);

const {data} = await axios.post(`/${PluginId}/image/byFile`, formData, {
const {data} = await axios.post(`/api/${PluginId}/image/byFile`, formData, {
headers: {
"Authorization": `Bearer ${JSON.parse(sessionStorage.getItem("jwtToken"))}`
}
Expand Down
7 changes: 1 addition & 6 deletions admin/src/components/medialib/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import {useLibrary} from '@strapi/helper-plugin';
import PropTypes from 'prop-types';

const MediaLibComponent = ({isOpen, onChange, toggle}) => {
/*const {
strapi: {
componentApi: {getComponent},
},
} = useLibrary();*/

const { components } = useLibrary();
const [data, setData] = useState(null);
const [isDisplayed, setIsDisplayed] = useState(false);
Expand All @@ -18,7 +14,6 @@ const MediaLibComponent = ({isOpen, onChange, toggle}) => {
}
}, [isOpen]);

//const Component = getComponent('media-library').Component;
const Component = components['media-library'];

const handleInputChange = data => {
Expand Down
2 changes: 0 additions & 2 deletions server/controllers/editorjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ module.exports = ({ strapi }) => ({

ogs(ctx.query, (error, results, response) => {

console.log(results);

const imageUrl = (results.ogImage && results.ogImage.url) ? { url: results.ogImage.url } : undefined;

resolve({
Expand Down

0 comments on commit 211c1f3

Please sign in to comment.