Пример #1
0
// Deletes all of the file tags for the specified value.
func (storage *Storage) DeleteFileTagsByValueId(tx *Tx, valueId entities.ValueId) error {
	fileTags, err := database.FileTagsByValueId(tx.tx, valueId)
	if err != nil {
		return err
	}

	if err := database.DeleteFileTagsByValueId(tx.tx, valueId); err != nil {
		return err
	}

	if err := storage.DeleteUntaggedFiles(tx, fileTags.FileIds()); err != nil {
		return err
	}

	return nil
}
Пример #2
0
// Retrieves the file tags with the specified value ID.
func (storage *Storage) FileTagsByValueId(tx *Tx, valueId entities.ValueId) (entities.FileTags, error) {
	return database.FileTagsByValueId(tx.tx, valueId)
}