email setup test

This commit is contained in:
Čarodej
2022-02-10 08:57:47 +01:00
parent 9f5172da85
commit b5c00e98df
2 changed files with 14 additions and 5 deletions
@@ -147,6 +147,10 @@
</div> </div>
</div> </div>
<InfoBox v-if="isError" type="error" class="!mb-5">
<p>Something went wrong, please try it again.</p>
</InfoBox>
<AuthButton class="w-full justify-center" icon="chevron-right" text="Save and Set General Settings" :loading="isLoading" :disabled="isLoading" /> <AuthButton class="w-full justify-center" icon="chevron-right" text="Save and Set General Settings" :loading="isLoading" :disabled="isLoading" />
</ValidationObserver> </ValidationObserver>
</AuthContent> </AuthContent>
@@ -211,6 +215,7 @@ export default {
}, },
data() { data() {
return { return {
isError: false,
isLoading: false, isLoading: false,
ossRegions: [ ossRegions: [
{ {
@@ -510,6 +515,7 @@ export default {
async EnvironmentSetupSubmit() { async EnvironmentSetupSubmit() {
if (this.$root.$data.config.isSetupWizardDemo) { if (this.$root.$data.config.isSetupWizardDemo) {
this.$router.push({name: 'AppSetup'}) this.$router.push({name: 'AppSetup'})
return
} }
// Validate fields // Validate fields
@@ -540,6 +546,10 @@ export default {
.catch((error) => { .catch((error) => {
// End loading // End loading
this.isLoading = false this.isLoading = false
if (error.response.status === 500) {
this.isError = true
}
}) })
}, },
}, },
@@ -14,8 +14,7 @@ class StoreEnvironmentSettingsController extends Controller
*/ */
public function __invoke( public function __invoke(
StoreEnvironmentSetupRequest $request, StoreEnvironmentSetupRequest $request,
): Response ): Response {
{
if (!app()->runningUnitTests()) { if (!app()->runningUnitTests()) {
$drivers = [ $drivers = [
'local' => [ 'local' => [
@@ -71,9 +70,9 @@ class StoreEnvironmentSettingsController extends Controller
]; ];
// Store credentials for mail // Store credentials for mail
setEnvironmentValue([ setEnvironmentValue(
$mail[$request->input('mail.driver')] $mail[$request->input('mailDriver')]
]); );
Artisan::call('config:cache'); Artisan::call('config:cache');
} }