@@ -39,7 +39,7 @@ class NetworkService {
39
39
_dio.options.headers["accept" ] = "application/json" ;
40
40
}
41
41
42
- final String baseUrl = "https://nikahtime.ru/api" ; // story didn`t use socket i think i will work with dev api
42
+ final String baseUrl = "https://dev. nikahtime.ru/api" ; // story didn`t use socket i think i will work with dev api
43
43
//LOGIN
44
44
final String login = "/login" ;
45
45
//REGISTRATION
@@ -360,6 +360,19 @@ class NetworkService {
360
360
return response;
361
361
}
362
362
363
+
364
+ StoryStore (String accessToken,String content,String type) async {
365
+ Map <String , String > headers = {
366
+ "Accept" : "application/json" ,
367
+ "Authorization" : "Bearer $accessToken " ,
368
+ "Content-Type" : "multipart/form-data"
369
+ };
370
+ var response= await http.post (Uri .parse ("${NetworkService ().baseUrl }/story/store" ),
371
+ body: {"type" : type, "content" : content, },headers: headers);
372
+ return response;
373
+
374
+ }
375
+
363
376
UpdateuserInfo (String accessToken, Object ? body) async {
364
377
print (body);
365
378
@@ -394,6 +407,25 @@ class NetworkService {
394
407
var response = await request.send ();
395
408
return response;
396
409
}
410
+ UploadFileRequestStroy (
411
+ String accessToken, String imagePath, String fileType) async {
412
+ Map <String , String > headers = {
413
+ "Accept" : "application/json" ,
414
+ "Authorization" : "Bearer $accessToken " ,
415
+ "Content-Type" : "multipart/form-data"
416
+ };
417
+ var request = http.MultipartRequest (
418
+ "POST" , Uri .parse ("${NetworkService ().baseUrl }/storeStory/file" ));
419
+ request.files.add (await http.MultipartFile .fromPath ('file' , imagePath));
420
+ request.fields['file' ] = imagePath;
421
+ request.fields['fileType' ] = fileType;
422
+ request.headers.addAll (headers);
423
+ print (request.fields);
424
+ var response = await request.send ();
425
+ return response;
426
+ }
427
+
428
+
397
429
398
430
Future <void > blockUser ({required int userId}) async {
399
431
SharedPreferences prefs = await SharedPreferences .getInstance ();
0 commit comments