Delete tags now possible.

This commit is contained in:
James Cole 2015-05-02 22:30:59 +02:00
parent c918c93f51
commit cd0c6439c2

View File

@ -230,6 +230,10 @@ class JournalRepository implements JournalRepositoryInterface
if (count($ids) > 0) {
DB::table('tag_transaction_journal')->where('transaction_journal_id', $journal->id)->whereNotIn('tag_id', $ids)->delete();
}
// if count is zero, delete them all:
if(count($ids) == 0) {
DB::table('tag_transaction_journal')->where('transaction_journal_id', $journal->id)->delete();
}
// connect each tag to journal (if not yet connected):
/** @var Tag $tag */