mirror of
https://git.rdcenter.ru/RDCenter/skb-kit.git
synced 2026-12-05 03:49:45 +00:00
Сверстать страницу проектов, сделать временное хранилище проектов, скорректировать маршрутизацию
This commit is contained in:
1 parent
b4fdabc853
commit
cb69de3427
9 files changed
+63
-14
No files matched your search
+14
-1
@@ -2,6 +2,7 @@ import * as WPAPI from 'wpapi';
|
||||
import { flatten } from 'lodash';
|
||||
|
||||
import reactPress from './reactPress';
|
||||
import projects from './projects.json';
|
||||
|
||||
const wp = new WPAPI(
|
||||
process.env.NODE_ENV === 'development'
|
||||
@@ -69,7 +70,6 @@ export async function getMedia(category, target = false) {
|
||||
for (let media of mediaLibrary[category]) {
|
||||
target[media.name].image = media.image;
|
||||
target[media.name].id = media.id;
|
||||
console.log(target[media.name].id);
|
||||
}
|
||||
|
||||
return target;
|
||||
@@ -80,4 +80,17 @@ export async function getMedia(category, target = false) {
|
||||
console.log(error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
export async function getProjects(id) {
|
||||
try {
|
||||
if (typeof id != 'undefined') {
|
||||
return projects[id];
|
||||
}
|
||||
|
||||
return projects;
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user