Add purges after set/edit commands
[gruntmaster-data.git] / lib / Gruntmaster / App / Command / Edit.pm
index 24785ab01996e300122fef193fbc39d719938655..3257903d469515ec527914b58f3c5ff9ed8caa60 100644 (file)
@@ -10,6 +10,9 @@ use File::Slurp qw/read_file write_file/;
 use Gruntmaster::App '-command';
 use Gruntmaster::Data;
 
+use Gruntmaster::App::Command::Set;
+BEGIN { *PAGES = *Gruntmaster::App::Command::Set::PAGES }
+
 sub usage_desc { '%c [-cjpu] edit id column' }
 
 sub validate_args {
@@ -28,6 +31,7 @@ sub execute {
        my $editor = $ENV{EDITOR} // 'editor';
        system $editor, $file;
        db->update($self->app->table, {$col => scalar read_file $file}, {id => $obj});
+       purge PAGES->{$self->app->table}.$_ for '', $obj;
 }
 
 1;
This page took 0.009598 seconds and 4 git commands to generate.