-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/#123 market api #136
Merged
Merged
Feat/#123 market api #136
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e29cae0
ν맀μνν¨μ λ° μμ μ©
KIM-JUHYEON-79 1f8b081
λν
μΌνμ΄μ§ μνν¨μ μ μ©
KIM-JUHYEON-79 930834b
μ°μ‘°ν λ° μ‘°ν
KIM-JUHYEON-79 89b63f3
μ’μμ μ€λ₯
KIM-JUHYEON-79 0dda931
Merge branch 'develop' of https://github.com/4Ailen/frontend into feaβ¦
KIM-JUHYEON-79 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import 'package:aliens/mockdatas/board_mockdata.dart'; | ||
import 'package:aliens/models/board_model.dart'; | ||
import 'package:aliens/models/market_articles.dart'; | ||
import 'package:flutter/widgets.dart'; | ||
import 'package:provider/provider.dart'; | ||
|
||
import '../apis/apis.dart'; | ||
import '../models/comment_model.dart'; | ||
import '../models/market_comment.dart'; | ||
|
||
class BookmarksProvider with ChangeNotifier { | ||
List<MarketBoard>? articleList; | ||
bool loading = false; | ||
List<MarketBoard>? bookmarksList; | ||
List<int>? marketArticleBookmarkCount; | ||
|
||
|
||
addBookmarks(int articleId, int index) async { | ||
loading = true; | ||
try { | ||
//μ’μμ μμ² | ||
print('μ΄κ±΄λλ'); | ||
marketArticleBookmarkCount![index] = await APIs.marketbookmark(articleId); | ||
print('μ΄κ±΄???'); | ||
|
||
} catch (e) { | ||
if (e == "AT-C-002") { | ||
await APIs.getAccessToken(); | ||
//μ’μμ μμ² | ||
marketArticleBookmarkCount![index] = await APIs.marketbookmark(articleId); | ||
|
||
} else { | ||
} | ||
} | ||
loading = false; | ||
notifyListeners(); | ||
getbookmarksCounts(); | ||
print('μ΄κ²λ λ λΌλ;;'); | ||
} | ||
|
||
getbookmarksCounts() async { | ||
articleList = await APIs.getMarketArticles(); | ||
marketArticleBookmarkCount = articleList!.map((marketboard) => marketboard.marketArticleBookmarkCount ?? 0).toList(); | ||
//print(marketboard.marketArticleBookmarkCount ?? 0); | ||
// print('λΆλ§ν¬κ°μ:${marketArticleBookmarkCount}'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MarketBoardPageμμ indexλ μ¬μ©νμ§ μμλ λ κ² κ°μλ° μ΄λ»κ² μκ°νμλμ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
λ€! provider λ°μμ€λκ±° μ½μ ν μ€νΈμ©λλ§κ³€ μ΄μ μ¬μ©νμ§ μμκ±°κ°μμ νμμμκ±°κ°μ΅λλ€ λ€μ 컀λ°μ μμ ν΄μ μ¬λ¦΄κ²μ