Skip to content

Instantly share code, notes, and snippets.

View oncode's full-sized avatar

Manuel Sommerhalder oncode

View GitHub Profile
@oncode
oncode / write-an-open-source-js-lib.md
Created March 6, 2017 08:28 — forked from deadcoder0904/write-an-open-source-js-lib.md
How to Write an Open Source JavaScript Library
@oncode
oncode / lifecycles.ts
Created October 16, 2024 16:20
Lifecycles file for strapi entity introducing path, parent and children field
const updateChildPaths = async (parent: any) => {
const children = await strapi.entityService.findMany(context, {
filters: { parent: parent.id },
});
for (const child of children) {
let newPath = `${parent.path}/${child.slug}`;
if (parent.slug === homeSlug) {
newPath = `/${child.slug}`;