mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Merge pull request #6864 from firefly-iii/update-build-2
Update build 2
This commit is contained in:
commit
bc47017e31
@ -104,6 +104,7 @@ class DeleteController extends Controller
|
||||
*/
|
||||
public function destroy(TransactionGroup $group): RedirectResponse
|
||||
{
|
||||
Log::debug(sprintf('Now in %s(#%d).', __METHOD__, $group->id));
|
||||
if (!$this->isEditableGroup($group)) {
|
||||
return $this->redirectGroupToAccount($group);
|
||||
}
|
||||
|
@ -98,17 +98,23 @@ class MassController extends Controller
|
||||
*/
|
||||
public function destroy(MassDeleteJournalRequest $request)
|
||||
{
|
||||
Log::debug(sprintf('Now in %s', __METHOD__));
|
||||
$ids = $request->get('confirm_mass_delete');
|
||||
$count = 0;
|
||||
if (is_array($ids)) {
|
||||
Log::debug('Array of IDs', $ids);
|
||||
/** @var string $journalId */
|
||||
foreach ($ids as $journalId) {
|
||||
Log::debug(sprintf('Searching for ID #%d', $journalId));
|
||||
/** @var TransactionJournal $journal */
|
||||
$journal = $this->repository->find((int)$journalId);
|
||||
if (null !== $journal && (int)$journalId === $journal->id) {
|
||||
if (null !== $journal && (int)$journalId === (int) $journal->id) {
|
||||
$this->repository->destroyJournal($journal);
|
||||
++$count;
|
||||
Log::debug(sprintf('Deleted transaction journal #%d', $journalId));
|
||||
continue;
|
||||
}
|
||||
Log::debug(sprintf('Could not find transaction journal #%d', $journalId));
|
||||
}
|
||||
}
|
||||
app('preferences')->mark();
|
||||
|
@ -32,6 +32,7 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Query\Builder;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
|
||||
/**
|
||||
@ -94,18 +95,22 @@ class TransactionGroup extends Model
|
||||
*/
|
||||
public static function routeBinder(string $value): TransactionGroup
|
||||
{
|
||||
Log::debug(sprintf('Now in %s("%s")', __METHOD__, $value));
|
||||
if (auth()->check()) {
|
||||
$groupId = (int)$value;
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
Log::debug(sprintf('User authenticated as %s', $user->email));
|
||||
/** @var TransactionGroup $group */
|
||||
$group = $user->transactionGroups()
|
||||
->with(['transactionJournals', 'transactionJournals.transactions'])
|
||||
->where('transaction_groups.id', $groupId)->first(['transaction_groups.*']);
|
||||
if (null !== $group) {
|
||||
Log::debug(sprintf('Found group #%d.', $group->id));
|
||||
return $group;
|
||||
}
|
||||
}
|
||||
Log::debug('Found no group.');
|
||||
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -529,7 +529,7 @@ export default {
|
||||
// if count is 0, send user onwards.
|
||||
if (this.createAnother) {
|
||||
// do message:
|
||||
this.success_message = this.$t('firefly.transaction_stored_link', {ID: groupId, title: title});
|
||||
this.success_message = this.$t('firefly.transaction_stored_link', {ID: groupId, title: $(title).text()});
|
||||
this.error_message = '';
|
||||
if (this.resetFormAfter) {
|
||||
// also clear form.
|
||||
|
@ -140,7 +140,7 @@ export default {
|
||||
|
||||
// post!
|
||||
axios.post('./api/v1/webhooks', data).then((response) => {
|
||||
this.success_message = response.data.message;
|
||||
this.success_message = $.text(response.data.message);
|
||||
// console.log('Will now go to redirectUser()');
|
||||
let webhookId = response.data.data.id;
|
||||
window.location.href = window.previousUrl + '?webhook_id=' + webhookId + '&message=created';
|
||||
|
@ -187,7 +187,7 @@ export default {
|
||||
|
||||
// post!
|
||||
axios.put('./api/v1/webhooks/' + this.id, data).then((response) => {
|
||||
this.success_message = response.data.message;
|
||||
this.success_message = $.text(response.data.message);
|
||||
// console.log('Will now go to redirectUser()');
|
||||
let webhookId = response.data.data.id;
|
||||
window.location.href = window.previousUrl + '?webhook_id=' + webhookId + '&message=updated';
|
||||
|
@ -290,7 +290,7 @@ export default {
|
||||
let button = $('#triggerButton');
|
||||
button.prop('disabled', true).addClass('disabled');
|
||||
|
||||
this.success_message = this.$t('firefly.webhook_was_triggered');
|
||||
this.success_message = $.text(this.$t('firefly.webhook_was_triggered'));
|
||||
// TODO actually trigger the webhook.
|
||||
axios.post('./api/v1/webhooks/' + this.id + '/trigger-transaction/' + journalId, {});
|
||||
button.prop('disabled', false).removeClass('disabled');
|
||||
|
Loading…
Reference in New Issue
Block a user