Skip to content

Commit

Permalink
feat: fix indexes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rob Ellison committed Aug 25, 2023
1 parent d92e309 commit 784861c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions components/etherpad/NewPadDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ export function NewPadDialog({ dialogOpen, handleDialog, siteContent }) {
frontmatter = {
type: docType,
[parent.toLowerCase()]: dirname(selectedDropDown),
title: title,
parentType: parent.toLowerCase(),
parentName: dirname(selectedDropDown)
title: title
};
}
const initialContent = matter.stringify('\n', frontmatter);
Expand Down Expand Up @@ -129,6 +127,8 @@ export function NewPadDialog({ dialogOpen, handleDialog, siteContent }) {
};

const handleDocTypeChange = async (x) => {

console.log('handleDocTypeChange:x: ', x)
setAvailableParents(parentContentElements[x] ?? [])
setDocType(x);

Expand Down
11 changes: 7 additions & 4 deletions pages/api/structure/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,19 @@ export default async function handler(req, res) {
// const parents = ['solutions', 'patterns', 'product', 'design', 'knowledge']
const getListOfKeys = (data) => Object.keys(data);
const parents = getListOfKeys(siteConfig.content);
// console.log('API:/api/structure:item', item)
// console.log('API:/api/structure:parents', parents)

// console.log('API:/api/structure:parents', parents)

for (let y of parents) {
if (item[y]) {
for (let key in siteConfig.content) {

const y = siteConfig.content[key];

if (item[y.reference]) {
// let directory = item[y].includes("/") ? item[y].split("/")[1] : '';

// let directory = path.dirname(item[y]);
let directory = item[y];
let directory = item[y.reference];
// console.log('API:/api/structure:directory', directory, ' ; ', item[y])

// Check if the key exists in the relatedContent object
Expand Down

0 comments on commit 784861c

Please sign in to comment.