mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-25 08:09:38 +02:00
Fix Merchants controller (#704)
* Add climate_control gem and test helper * Replace ENV mods in upgrades test * Replace ENV mods in registrations test * Remove ENV references in hostings controller * Update ENV refs in mailer test * ActiveStorage cleanup * Consolidate queue config so appropriate adapter runs in test environment * Make test environment more explicit * Centralize self hosting config * Remove flaky system test * Fix merchants controller actions
This commit is contained in:
parent
5dfbba403a
commit
75cdddc6ca
2 changed files with 4 additions and 12 deletions
|
@ -10,22 +10,16 @@ class Transactions::MerchantsController < ApplicationController
|
|||
end
|
||||
|
||||
def create
|
||||
if Current.family.transaction_merchants.create(merchant_params)
|
||||
redirect_to transaction_merchants_path, notice: t(".success")
|
||||
else
|
||||
render transaction_merchants_path, status: :unprocessable_entity, notice: t(".error")
|
||||
end
|
||||
Current.family.transaction_merchants.create!(merchant_params)
|
||||
redirect_to transaction_merchants_path, notice: t(".success")
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def update
|
||||
if @merchant.update(merchant_params)
|
||||
redirect_to transaction_merchants_path, notice: t(".success")
|
||||
else
|
||||
render transaction_merchants_path, status: :unprocessable_entity, notice: t(".error")
|
||||
end
|
||||
@merchant.update!(merchant_params)
|
||||
redirect_to transaction_merchants_path, notice: t(".success")
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
|
|
@ -59,7 +59,6 @@ en:
|
|||
edit_categories: Edit categories
|
||||
merchants:
|
||||
create:
|
||||
error: Error creating merchant
|
||||
success: New merchant created successfully
|
||||
destroy:
|
||||
success: Merchant deleted successfully
|
||||
|
@ -84,7 +83,6 @@ en:
|
|||
new:
|
||||
title: New merchant
|
||||
update:
|
||||
error: Error updating merchant
|
||||
success: Merchant updated successfully
|
||||
update:
|
||||
success: Transaction updated successfully
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue