-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #263 from hypha-dao/feature/show_dao_name
Show DAO name on invite
- Loading branch information
Showing
13 changed files
with
192 additions
and
108 deletions.
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
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,24 @@ | ||
import 'package:hypha_wallet/core/error_handler/model/hypha_error.dart'; | ||
import 'package:hypha_wallet/core/network/api/services/dao_service.dart'; | ||
import 'package:hypha_wallet/core/network/models/dao_data_model.dart'; | ||
import 'package:hypha_wallet/core/network/models/network.dart'; | ||
import 'package:hypha_wallet/ui/architecture/result/result.dart' as HResult; | ||
|
||
class GetDaoNameUseCase { | ||
final DaoService _daoService; | ||
|
||
GetDaoNameUseCase(this._daoService); | ||
|
||
Future<HResult.Result<String, HyphaError>> run(String daoId, Network network) async { | ||
final HResult.Result<DaoData?, HyphaError> data = await _daoService.getDaoById(daoId: daoId, network: network); | ||
final daoName = data.asValue?.value?.settingsDaoTitle; | ||
|
||
if (daoName != null) { | ||
return HResult.Result.value(daoName); | ||
} else if (data.isError) { | ||
return HResult.Result.error(data.asError!.error); | ||
} else { | ||
return HResult.Result.error(HyphaError.generic('Could not find dao with ID: $daoId')); | ||
} | ||
} | ||
} |
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.