From 8c8d9251cdb67383ff9aeab4920ee3d92e0ef4a1 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Thu, 31 Oct 2019 16:25:43 -0600 Subject: [PATCH] add,update -> set --- MIGRATION_GUIDE_V2_V3.md | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/MIGRATION_GUIDE_V2_V3.md b/MIGRATION_GUIDE_V2_V3.md index b1673c8..f969018 100644 --- a/MIGRATION_GUIDE_V2_V3.md +++ b/MIGRATION_GUIDE_V2_V3.md @@ -329,11 +329,10 @@ Greenlock.create({ The manager itself is, again relatively simple: - find(options) -- add(siteConfig) -- update(updates) +- set(siteConfig) - remove(options) - defaults(globalOptions) (as setter) -- defaults() => globalOptions (as getter) + - defaults() => globalOptions (as getter) `/path/to/manager.js`: @@ -360,13 +359,11 @@ module.exports.create = function() { return []; }; - manage.add = function({ subject, altnames }) { - return setSiteConfig(subject, { subject, altnames }); - }; + manage.set = function(opts) { + // this is called by greenlock.add({ subject, altnames }) + // it's also called by greenlock._update({ subject, renewAt }) - manage.update = function({ subject, renewAt }) { - // update the `renewAt` date of the site by `subject` - return mergSiteConfig(subject, { renewAt }); + return mergSiteConfig(subject, opts); }; manage.remove = function({ subject, altname }) {