Skip to content

Commit

Permalink
feat(endpoint-posts): delete non-mf2 post values
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrobertlloyd committed Jan 16, 2024
1 parent ef8b4f8 commit bcb45fd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/endpoint-posts/lib/controllers/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ export const formController = {
values.location = getLocationProperty(values);
}

// Delete non-MF2 properties
// @todo Use `properties` for field names whose values should be submitted
delete values["all-day"];
delete values.geo;
delete values["post-type"];
delete values["publication-date"];

const mf2 = jf2ToMf2({ properties: sanitise(values) });

let jsonBody = mf2;
Expand Down

0 comments on commit bcb45fd

Please sign in to comment.