Skip to content

Commit 9952fb2

Browse files
committed
update
1 parent d1278e0 commit 9952fb2

4 files changed

Lines changed: 6 additions & 7 deletions

File tree

backend/src/controller/user.controller.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ export const register = async (request: Request, response: any) => {
2727
try {
2828
const existingUsers = await findUser({email})
2929
if(existingUsers){
30+
console.log(existingUsers);
3031
return response.status(202).json({
3132
message: "email already exists, Please Sign-in",
3233
user: existingUsers,
3334
success: false,
3435
})}
3536

36-
let publicUrlData;
37-
let user;
37+
let publicUrlData;
38+
let user;
3839

3940
if(!picture){
4041
const files = file?.originalname.split(" ").join("");

bytbox_app/lib/api/backend_api_client.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ class BackendApiClient {
4242
}else{
4343
request.fields['picture'] = profilurl;
4444
}
45-
4645
final response = await request.send();
4746
final responseBody = await response.stream.bytesToString();
4847
final body = jsonDecode(responseBody);
48+
print(responseBody);
4949
if(response.statusCode != 200 && response.statusCode!=201){
5050
if(gg == true){
5151
return jsonDecode(responseBody);
@@ -72,16 +72,13 @@ class BackendApiClient {
7272
'password': password,
7373
}),
7474
);
75-
print(email);
7675
final responseBody = jsonDecode(response.body);
7776
if(response.statusCode != 200 && response.statusCode!=201){
7877
if(response.statusCode==202){
7978
throw Exception( 'Something went wrong');
8079
}
8180
throw Exception('Something went wrong');
8281
}
83-
print('Something went wrong');
84-
print(responseBody);
8582
return responseBody;
8683
}
8784

bytbox_app/lib/backend_notifier/backend_notifier.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class BackendNotifier extends AsyncNotifier <Map<String, dynamic>?> {
6262
Future<void> googleLoginUser() async {
6363
final api = ref.read(backendApiProvider);
6464
final user = await signInWithGoogle();
65+
print(user);
6566
state = await AsyncValue.guard(() async {
6667
final result = await api.registerUser(
6768
name: user['name'],

bytbox_app/lib/screens/login_screen.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
3939
ref.listen(backendNotifierProvider, (prev, next){
4040
next.whenOrNull(
4141
error: (error, _) {
42+
print(error);
4243
final message = error is Exception
4344
? error.toString().replaceFirst('Exception: ', '')
4445
: 'Something went wrong';
@@ -140,7 +141,6 @@ class _LoginScreenState extends ConsumerState<LoginScreen> {
140141
IconButton(
141142
onPressed: (){
142143
ref.read(backendNotifierProvider.notifier).googleLoginUser();
143-
signInWithGoogle();
144144
},
145145
icon: Icon(Icons.g_mobiledata_rounded)
146146
)

0 commit comments

Comments
 (0)