MCPcopy Create free account
hub / github.com/TruthHun/BookStack / Delete

Method Delete

models/attachment.go:57–65  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55}
56
57func (m *Attachment) Delete() (err error) {
58 o := orm.NewOrm()
59
60 if _, err = o.Delete(m); err != nil {
61 return err
62 }
63
64 return os.Remove(strings.TrimLeft(m.FilePath, "./"))
65}
66
67func (m *Attachment) Find(id int) (*Attachment, error) {
68 if id <= 0 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected