Skip to content

Commit

Permalink
Delete sandbox-page frontend
Browse files Browse the repository at this point in the history
This PR will be backend-only, so we don't need this frontend test code.
  • Loading branch information
rmunn committed Jun 11, 2024
1 parent ef34294 commit ccea198
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 77 deletions.
60 changes: 1 addition & 59 deletions frontend/src/lib/gql/mutations.ts
Original file line number Diff line number Diff line change
@@ -1,66 +1,8 @@
import type { $OpResult, DeleteUserByAdminOrSelfInput, DeleteUserByAdminOrSelfMutation, SoftDeleteProjectMutation, DeleteDraftProjectMutation, AcquireProjectMutation, ReleaseProjectMutation } from './types';
import type { $OpResult, DeleteUserByAdminOrSelfInput, DeleteUserByAdminOrSelfMutation, SoftDeleteProjectMutation, DeleteDraftProjectMutation } from './types';

import { getClient } from './gql-client';
import { graphql } from './generated';

export async function _acquireProject(orgId: string, projectId: string): $OpResult<AcquireProjectMutation> {
//language=GraphQL
const result = await getClient()
.mutation(
graphql(`
mutation AcquireProject($input: AcquireProjectInput!) {
acquireProject(input: $input) {
organization {
id
projects {
id
name
code
}
}
errors {
... on Error {
__typename
message
}
}
}
}
`),
{ input: { orgId, projectId } },
);
return result;
}

export async function _releaseProject(orgId: string, projectId: string): $OpResult<ReleaseProjectMutation> {
//language=GraphQL
const result = await getClient()
.mutation(
graphql(`
mutation ReleaseProject($input: ReleaseProjectInput!) {
releaseProject(input: $input) {
organization {
id
projects {
id
name
code
}
}
errors {
... on Error {
__typename
message
}
}
}
}
`),
{ input: { orgId, projectId } },
);
return result;
}

export async function _deleteUserByAdminOrSelf(input: DeleteUserByAdminOrSelfInput): $OpResult<DeleteUserByAdminOrSelfMutation> {
//language=GraphQL
const result = await getClient()
Expand Down
18 changes: 0 additions & 18 deletions frontend/src/routes/(unauthenticated)/sandbox/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import ConfirmModal from '$lib/components/modals/ConfirmModal.svelte';
import {delay} from '$lib/util/time';
import DeleteModal from '$lib/components/modals/DeleteModal.svelte';
import { _acquireProject, _releaseProject } from '$lib/gql/mutations';
function uploadFinished(): void {
alert('upload done!');
Expand Down Expand Up @@ -48,17 +47,6 @@ function preFillForm(): void {
let modal: ConfirmModal;
let deleteModal: DeleteModal;
const testOrgId = '292c80e6-a815-4cd1-9ea2-34bd01274de6';
const sena3Id = '0ebc5976-058d-4447-aaa7-297f8569f968';
async function acquire() {
console.log(await _acquireProject(testOrgId, sena3Id));
}
async function release() {
console.log(await _releaseProject(testOrgId, sena3Id));
}
</script>
<PageBreadcrumb>Hello from sandbox</PageBreadcrumb>
<PageBreadcrumb>second value</PageBreadcrumb>
Expand All @@ -82,12 +70,6 @@ async function release() {
<button class="btn" on:click={fetch500}>Fetch 500</button>
<button class="btn" on:click={gqlThrows500}>GQL 500</button>
</div>
<div class="card w-96 bg-base-200 shadow-lg">
<div class="card-body">
<button class="btn btn-success" on:click={acquire}>acquire</button>
<button class="btn btn-accent" on:click={release}>release</button>
</div>
</div>
<div class="card w-96 bg-base-200 shadow-lg">
<div class="card-body">
<TusUpload internalButton endpoint="/api/tus-test" accept="image/*" on:uploadComplete={uploadFinished}/>
Expand Down

0 comments on commit ccea198

Please sign in to comment.