forked from yaso_meth/mih-project
Merge pull request #85 from yaso-meth/FIX--Add-business-error-fix
FIX--Add-business-error-fix
This commit is contained in:
@@ -15,13 +15,13 @@ abstract class AppEnviroment {
|
||||
case Enviroment.dev:
|
||||
{
|
||||
//================= Android Dev Urls =================
|
||||
// baseApiUrl = "http://10.0.2.2:8080";
|
||||
// baseFileUrl = "http://10.0.2.2:9000";
|
||||
// baseAiUrl = "http://10.0.2.2:11434";
|
||||
baseApiUrl = "http://10.0.2.2:8080";
|
||||
baseFileUrl = "http://10.0.2.2:9000";
|
||||
baseAiUrl = "http://10.0.2.2:11434";
|
||||
//================= Web Dev Urls =================
|
||||
baseApiUrl = "http://localhost:8080";
|
||||
baseFileUrl = "http://localhost:9000";
|
||||
baseAiUrl = "http://localhost:11434";
|
||||
// baseApiUrl = "http://localhost:8080";
|
||||
// baseFileUrl = "http://localhost:9000";
|
||||
// baseAiUrl = "http://localhost:11434";
|
||||
whatsappAccessToken =
|
||||
"EAAPINXuNFdYBOzBjTcvZA2iPXEHbHRF9uNXyP3ihkPRUcBqKNru5g9NKRRKkFaiaITEzO3BMo6CjdUmlDH4qYTW2mzDrZB4Q21ZCEZBgECZCu27vfaOXJZCYQLNxwoXkrZBRYv8ZAP37f69r3z9JxLQxdxn9gwqA3oNZAlBBRapJQzxOr6pZBTdI3bbjbu17ZBIwRcF4JCqPDCNLEZCI3bmHwEd2i2niNMYZD";
|
||||
//fingerPrintPluginKey = 'h5X7a5j14iUZCobI1ZeX';
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:Mzansi_Innovation_Hub/mih_objects/arguments.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import '../../main.dart';
|
||||
@@ -97,7 +98,11 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
|
||||
);
|
||||
if (response.statusCode == 201) {
|
||||
uploadSelectedFile(selectedSignature, signtureController);
|
||||
Navigator.of(context).pushNamed('/');
|
||||
// Navigator.of(context).pushNamed('/');
|
||||
Navigator.of(context).popAndPushNamed(
|
||||
'/',
|
||||
arguments: AuthArguments(false, false),
|
||||
);
|
||||
String message =
|
||||
"Your business profile is now live! You can now start connecting with customers and growing your business.";
|
||||
successPopUp(message);
|
||||
@@ -136,7 +141,9 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
|
||||
if (response.statusCode == 201) {
|
||||
var businessResponse = jsonDecode(response.body);
|
||||
createBusinessUserAPICall(businessResponse['business_id']);
|
||||
uploadSelectedFile(selectedLogo, logonameController);
|
||||
|
||||
Navigator.of(context).pop();
|
||||
// uploadSelectedFile(selectedLogo, logonameController);
|
||||
} else {
|
||||
internetConnectionPopUp();
|
||||
}
|
||||
|
||||
@@ -132,7 +132,7 @@ async def insert_business_details(itemRequest : businessInsertRequest, session:
|
||||
db = database.dbConnection.dbAppDataConnect()
|
||||
cursor = db.cursor()
|
||||
query = "insert into business "
|
||||
query += "(business_id, Name, type, registration_no, logo_name, logo_path, contact_no, bus_email, gps_location, practice_no, vat_no), "
|
||||
query += "(business_id, Name, type, registration_no, logo_name, logo_path, contact_no, bus_email, gps_location, practice_no, vat_no) "
|
||||
query += "values (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)"
|
||||
uuidString = str(uuid.uuid1())
|
||||
userData = (uuidString,
|
||||
@@ -147,6 +147,9 @@ async def insert_business_details(itemRequest : businessInsertRequest, session:
|
||||
itemRequest.practice_no,
|
||||
itemRequest.vat_no)
|
||||
try:
|
||||
|
||||
print(query)
|
||||
print(userData)
|
||||
cursor.execute(query, userData)
|
||||
except Exception as error:
|
||||
raise HTTPException(status_code=404, detail=error)
|
||||
|
||||
Reference in New Issue
Block a user