Merge pull request #431 from filecoin-project/@tarafanlin/emptyprofileview

replace test slates ids with slates exists in prod
This commit is contained in:
CAKE 2020-11-20 01:01:51 -08:00 committed by GitHub
commit e23a9d9d24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 35 deletions

View File

@ -1,27 +1,10 @@
import { runQuery } from "~/node_common/data/utilities";
export default async ({ id }) => {
export default async ({ ids }) => {
return await runQuery({
label: "GET_SLATES_BY_IDS",
queryFn: async (DB) => {
const query = await DB.select("*").from("slates").whereIn("id", [
//NOTE(tara): slates in localhost for testing
"857ad84d-7eff-4861-a988-65c84b62fc23",
"81fa0b39-0e96-4c7f-8587-38468bb67cb3",
"c4e8dad7-4ba0-4f25-a92a-c73ef5522d29",
"df05cb1f-2ecf-4872-b111-c4b8493d08f8",
"435035e6-dee4-4bbf-9521-64c219a527e7",
"ac907aa3-2fb2-46fd-8eba-ec8ceb87b5eb",
//NOTE(tara): slates in prod
// "d2861ac4-fc41-4c07-8f21-d0bf06be364c",
// "9c2c458c-d92a-4e81-a4b6-bf6ab4607470",
// "7f461144-0647-43d7-8294-788b37ae5979",
// "f72c2594-b8ac-41f6-91e0-b2da6788ae23",
// "a0d6e2f2-564d-47ed-bf56-13c42634703d",
// "0ba92c73-92e7-4b00-900e-afae4856c9ea",
]);
const query = await DB.select("*").from("slates").whereIn("id", ids);
if (!query || query.error) {
return [];
}

View File

@ -240,7 +240,23 @@ app.prepare().then(async () => {
publicOnly: true,
});
const exploreSlates = await Data.getSlatesByIds("id", [
let exploreSlates = [];
if (Environment.IS_PRODUCTION) {
exploreSlates = await Data.getSlatesByIds({
ids: [
//NOTE(tara): slates in prod
"d2861ac4-fc41-4c07-8f21-d0bf06be364c",
"9c2c458c-d92a-4e81-a4b6-bf6ab4607470",
"7f461144-0647-43d7-8294-788b37ae5979",
"f72c2594-b8ac-41f6-91e0-b2da6788ae23",
"a0d6e2f2-564d-47ed-bf56-13c42634703d",
"0ba92c73-92e7-4b00-900e-afae4856c9ea",
],
});
} else {
exploreSlates = await Data.getSlatesByIds({
ids: [
//NOTE(tara): slates in localhost for testing
"857ad84d-7eff-4861-a988-65c84b62fc23",
"81fa0b39-0e96-4c7f-8587-38468bb67cb3",
@ -248,15 +264,9 @@ app.prepare().then(async () => {
"df05cb1f-2ecf-4872-b111-c4b8493d08f8",
"435035e6-dee4-4bbf-9521-64c219a527e7",
"ac907aa3-2fb2-46fd-8eba-ec8ceb87b5eb",
//NOTE(tara): slates in prod
// "d2861ac4-fc41-4c07-8f21-d0bf06be364c",
// "9c2c458c-d92a-4e81-a4b6-bf6ab4607470",
// "7f461144-0647-43d7-8294-788b37ae5979",
// "f72c2594-b8ac-41f6-91e0-b2da6788ae23",
// "a0d6e2f2-564d-47ed-bf56-13c42634703d",
// "0ba92c73-92e7-4b00-900e-afae4856c9ea",
]);
],
});
}
return app.render(req, res, "/_/profile", {
viewer,