Include path and hashes in destroy hook input (#2102)

This commit is contained in:
WithoutPants
2021-12-13 14:38:00 +11:00
committed by GitHub
parent 9a8f05d826
commit 79e01589ca
6 changed files with 91 additions and 10 deletions

View File

@@ -494,12 +494,19 @@ func (r *mutationResolver) GalleryDestroy(ctx context.Context, input models.Gall
// call post hook after performing the other actions
for _, gallery := range galleries {
r.hookExecutor.ExecutePostHooks(ctx, gallery.ID, plugin.GalleryDestroyPost, input, nil)
r.hookExecutor.ExecutePostHooks(ctx, gallery.ID, plugin.GalleryDestroyPost, plugin.GalleryDestroyInput{
GalleryDestroyInput: input,
Checksum: gallery.Checksum,
Path: gallery.Path.String,
}, nil)
}
// call image destroy post hook as well
for _, img := range imgsDestroyed {
r.hookExecutor.ExecutePostHooks(ctx, img.ID, plugin.ImageDestroyPost, nil, nil)
r.hookExecutor.ExecutePostHooks(ctx, img.ID, plugin.ImageDestroyPost, plugin.ImageDestroyInput{
Checksum: img.Checksum,
Path: img.Path,
}, nil)
}
return true, nil