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