mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-27 19:29:57 +03:00
slate: consistency adjustments for constants
This commit is contained in:
parent
0ed8cd6df5
commit
6196f3a568
@ -28,6 +28,7 @@ export default class SlateMediaObjectPreview extends React.Component {
|
||||
// NOTE(jim):
|
||||
// This is a hack to catch this undefined case I don't want to track down yet.
|
||||
const url = this.props.url.replace("https://undefined", "https://");
|
||||
console.log(url);
|
||||
|
||||
let element = <div css={STYLES_ENTITY}>No Preview</div>;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as MW from "~/node_common/middleware";
|
||||
import { IPFS_GATEWAY_DOMAIN } from "~/node_common/constants";
|
||||
import * as Constants from "~/node_common/constants";
|
||||
import * as Utilities from "~/node_common/utilities";
|
||||
import * as Data from "~/node_common/data";
|
||||
|
||||
@ -12,7 +12,9 @@ export default async (req, res) => {
|
||||
|
||||
const id = Utilities.getIdFromCookie(req);
|
||||
if (!id) {
|
||||
return res.status(403).json({ decorator: "SERVER_ADD_TO_SLATE_USER_NOT_FOUND", error: true });
|
||||
return res
|
||||
.status(403)
|
||||
.json({ decorator: "SERVER_ADD_TO_SLATE_USER_NOT_FOUND", error: true });
|
||||
}
|
||||
|
||||
const user = await Data.getUserById({
|
||||
@ -49,7 +51,7 @@ export default async (req, res) => {
|
||||
});
|
||||
}
|
||||
|
||||
const cid = req.body.data.ipfs.replace('/ipfs/')
|
||||
const cid = req.body.data.ipfs.replace("/ipfs/");
|
||||
const objects = [
|
||||
...slate.data.objects,
|
||||
{
|
||||
@ -58,7 +60,7 @@ export default async (req, res) => {
|
||||
name: req.body.data.name,
|
||||
title: req.body.data.title,
|
||||
type: req.body.data.type,
|
||||
url: `https://${cid}.${IPFS_GATEWAY_DOMAIN}`
|
||||
url: `https://${cid}.${Constants.IPFS_GATEWAY_DOMAIN}`,
|
||||
},
|
||||
];
|
||||
|
||||
@ -102,5 +104,7 @@ export default async (req, res) => {
|
||||
});
|
||||
}
|
||||
|
||||
return res.status(200).json({ decorator: "SERVER_SLATE_ADD_TO_SLATE", slate });
|
||||
return res
|
||||
.status(200)
|
||||
.json({ decorator: "SERVER_SLATE_ADD_TO_SLATE", slate });
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as MW from "~/node_common/middleware";
|
||||
import * as Data from "~/node_common/data";
|
||||
import { IPFS_GATEWAY_DOMAIN } from "~/node_common/constants";
|
||||
import * as Constants from "~/node_common/constants";
|
||||
import * as LibraryManager from "~/node_common/managers/library";
|
||||
import * as Strings from "~/common/strings";
|
||||
import * as Upload from "~/node_common/upload";
|
||||
@ -114,8 +114,8 @@ export default async (req, res) => {
|
||||
});
|
||||
}
|
||||
|
||||
const cid = req.body.data.ipfs.replace('/ipfs/')
|
||||
const url = `https://${cid}.${IPFS_GATEWAY_DOMAIN}`
|
||||
const cid = req.body.data.ipfs.replace("/ipfs/");
|
||||
const url = `https://${cid}.${Constants.IPFS_GATEWAY_DOMAIN}`;
|
||||
const newSlateObjectEntity = {
|
||||
id: updatedData.id,
|
||||
name: updatedData.name,
|
||||
|
Loading…
Reference in New Issue
Block a user