-
Notifications
You must be signed in to change notification settings - Fork 8
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 #9 from hootanht/main
Rename Education to Organization. ab#20103
- Loading branch information
Showing
22 changed files
with
673 additions
and
109 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
8 changes: 4 additions & 4 deletions
8
src/CrystallineSociety/Client/Shared/Pages/EducationProgramPage.razor
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
45 changes: 45 additions & 0 deletions
45
src/CrystallineSociety/Server/Api/Controllers/OrganizationController.cs
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,45 @@ | ||
using CrystallineSociety.Server.Api.Services.Implementations; | ||
using CrystallineSociety.Shared.Dtos.Organization; | ||
|
||
namespace CrystallineSociety.Server.Api.Controllers; | ||
|
||
[Route("api/[controller]/[action]")] | ||
[ApiController] | ||
[AllowAnonymous] | ||
public partial class OrganizationController : AppControllerBase | ||
{ | ||
|
||
/// <summary> | ||
/// Education program service for syncing badge systems with education programs. | ||
/// </summary> | ||
[AutoInject] | ||
public IOrganizationService OrganizationService { get; set; } | ||
|
||
/// <summary> | ||
/// Syncs the badge system with an education program. | ||
/// </summary> | ||
/// <param name="organization">The education program to sync.</param> | ||
/// <param name="cancellationToken">Cancellation token.</param> | ||
[HttpPost] | ||
public async Task SyncOrganizationBadgesAsync(OrganizationDto organization, CancellationToken cancellationToken) | ||
{ | ||
await OrganizationService.SyncBadgeSystemAsync(organization.Code, cancellationToken); | ||
} | ||
|
||
/// <summary> | ||
/// Retrieves all education programs. | ||
/// </summary> | ||
/// <param name="cancellationToken">Cancellation token.</param> | ||
/// <returns>All education programs.</returns> | ||
[HttpGet] | ||
public async Task<List<OrganizationDto>> GetOrganizationsAsync(CancellationToken cancellationToken) | ||
{ | ||
return Mapper.Map<List<OrganizationDto>>(await OrganizationService.GetAllOrganizationAsync(cancellationToken)); | ||
} | ||
|
||
[HttpGet] | ||
public async Task<OrganizationDto> GetOrganizationByCodeAsync(string code, CancellationToken cancellationToken) | ||
{ | ||
return Mapper.Map<OrganizationDto>(await OrganizationService.GetOrganizationAsync(code, cancellationToken)); | ||
} | ||
} |
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.