Skip to content

Commit

Permalink
fix(endpoint-micropub): use timezone when updating post paths
Browse files Browse the repository at this point in the history
  • Loading branch information
paulrobertlloyd committed Jan 2, 2021
1 parent 4757446 commit a55bed5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/endpoint-micropub/lib/post-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ export const postData = {
throw new Error('No update operation provided');
}

const {me, posts, postTypes} = publication;
const {me, posts, postTypes, timeZone} = publication;

const post = await posts.findOne({
'properties.url': url
});
Expand Down Expand Up @@ -137,8 +138,8 @@ export const postData = {
properties['post-type'] = type;

// Post paths
const path = renderPath(typeConfig.post.path, properties);
const updatedUrl = renderPath(typeConfig.post.url, properties);
const path = renderPath(typeConfig.post.path, properties, timeZone);
const updatedUrl = renderPath(typeConfig.post.url, properties, timeZone);
properties.url = getPermalink(me, updatedUrl);

// Return post data
Expand Down

0 comments on commit a55bed5

Please sign in to comment.