Skip to content

Commit

Permalink
Merge pull request #92 from soonaverse/feat/mint_and_approve_col
Browse files Browse the repository at this point in the history
Change logic when collection is approved
  • Loading branch information
adamunchained authored Nov 22, 2023
2 parents ae2490c + 9f5637f commit 44a2c8f
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 47 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
node-version: 20
- name: Install Dependencies
run: npm install
- name: Copy ENV variables
run: cp -f src/environments/environment.prod.ts src/environments/environment.ts
- name: Build project
run: npm run build
- name: Publish to Cloudflare Pages
Expand Down
3 changes: 0 additions & 3 deletions src/app/@api/collection.api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ export class CollectionApi extends BaseApi<Collection> {
public update = (req: WenRequest): Observable<Collection | undefined> =>
this.request(WEN_FUNC.updateCollection, req);

public approve = (req: WenRequest): Observable<Collection | undefined> =>
this.request(WEN_FUNC.approveCollection, req);

public reject = (req: WenRequest): Observable<Collection | undefined> =>
this.request(WEN_FUNC.rejectCollection, req);
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
>...)
</ng-container>
</ng-container>
<ng-template #mintText i18n>Mint Collection</ng-template>
<ng-template #mintText i18n>Mint & Publish Collection</ng-template>
</button>

<div
Expand Down
24 changes: 0 additions & 24 deletions src/app/pages/collection/pages/collection/collection.page.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,6 @@
<h1 class="mt-3 mb-0 lg:mt-2">{{ (data.collection$ | async)?.name }}</h1>

<div class="w-full mt-10 mb-4 space-y-4" *ngIf="(deviceService.isMobile$ | async)">
<button
nz-button
nzType="primary"
(click)="approve()"
*ngIf="data.isPending(data.collection$ | async) && (data.isGuardianWithinSpace$ | async)"
nzBlock
nzSize="large"
i18n
>
Publish Collection
</button>

<button
nz-button
class="wen-secondary"
Expand Down Expand Up @@ -289,18 +277,6 @@ <h1 class="mt-3 mb-0 lg:mt-2">{{ (data.collection$ | async)?.name }}</h1>
style="max-width: 450px"
*ngIf="(deviceService.isDesktop$ | async)"
>
<button
nz-button
nzType="primary"
(click)="approve()"
*ngIf="data.isPending(data.collection$ | async) && (data.isGuardianWithinSpace$ | async)"
nzBlock
nzSize="large"
i18n
>
Publish Collection
</button>

<button
nz-button
class="wen-secondary"
Expand Down
19 changes: 0 additions & 19 deletions src/app/pages/collection/pages/collection/collection.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,25 +200,6 @@ export class CollectionPage implements OnInit, OnDestroy {
return CollectionType;
}

public async approve(): Promise<void> {
if (!this.data.collection$.value?.uid) {
return;
}

await this.auth.sign(
{
uid: this.data.collection$.value.uid,
},
(sc, finish) => {
this.notification
.processRequest(this.collectionApi.approve(sc), 'Approved.', finish)
.subscribe(() => {
// none.
});
},
);
}

public async reject(): Promise<void> {
if (!this.data.collection$.value?.uid) {
return;
Expand Down

0 comments on commit 44a2c8f

Please sign in to comment.