Skip to content

Commit

Permalink
feat(endpoint-micropub): remove uuid token
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrobertlloyd committed Mar 30, 2024
1 parent 1a763a5 commit 6c6590e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 0 additions & 3 deletions packages/endpoint-micropub/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ export const renderPath = async (path, properties, application) => {
// Add slug token
tokens.slug = properties.slug;

// Add UUID token
tokens.uuid = crypto.randomUUID();

// Populate URI template path with properties
path = supplant(path, tokens);

Expand Down
7 changes: 2 additions & 5 deletions packages/endpoint-micropub/test/unit/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ describe("endpoint-media/lib/utils", () => {
});

it("Renders path from URI template and properties", async () => {
const template = "{yyyy}/{MM}/{uuid}/{slug}";
const template = "{yyyy}/{MM}/{slug}";
const properties = {
published: "2020-01-01",
slug: "foo",
Expand All @@ -85,10 +85,7 @@ describe("endpoint-media/lib/utils", () => {
};
const result = await renderPath(template, properties, application);

assert.match(
result,
/\d{4}\/\d{2}\/[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}\/foo/,
);
assert.match(result, /\d{4}\/\d{2}\/foo/);
});

it("Convert string to array if not already an array", () => {
Expand Down

0 comments on commit 6c6590e

Please sign in to comment.