feat: pin file after basic upload

This commit is contained in:
Derrick Hammer 2023-06-09 07:06:33 -04:00
parent 5579ab85a3
commit 892f093d93
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 7 additions and 0 deletions

View File

@ -38,6 +38,13 @@ func (f *FilesController) PostUpload() {
return
}
err = files.Pin(upload.Hash, upload.AccountID)
if internalError(ctx, err) {
logger.Get().Debug("failed pinning file", zap.Error(err))
return
}
cidString, err := cid.EncodeString(upload.Hash, uint64(meta.Size))
if internalError(ctx, err) {