Skip to content

Commit

Permalink
fix: 🐛 remove irrelevant code
Browse files Browse the repository at this point in the history
  • Loading branch information
slugb0t committed Jul 23, 2024
1 parent 448c37a commit 595c307
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions docs/app/ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ const saveExpectoDraft = async () => {
submitLoading.value = true;
const body = {
licenseId: licenseId.value,
licenseContent: licenseContent.value,
expectoContent: expectoContent.value,
};
await $fetch(`/api/expecto/${identifier}`, {
Expand All @@ -112,9 +111,9 @@ const saveExpectoDraft = async () => {
});
})
.catch((error) => {
console.error('Failed to save license draft:', error);
console.error('Failed to save expecto_patronum draft:', error);
push.error({
title: 'Failed to save license draft',
title: 'Failed to save expecto_patronum draft',
message: 'Please try again later',
});
})
Expand All @@ -127,7 +126,7 @@ const saveExpectoAndPush = async () => {
submitLoading.value = true;
const body = {
licenseContent: licenseContent.value,
expectoContent: expectoContent.value,
};
await $fetch(`/api/expecto/${identifier}`, {
Expand Down Expand Up @@ -327,7 +326,7 @@ export default defineEventHandler(async (event) => {
});
}

// Check if the user is authorized to access the codeMetadata request
// Check if the user is authorized to access the request
await repoWritePermissions(event, expectoRequest.owner, expectoRequest.repo);

const response: ExpectoRequestGetResponse = {
Expand All @@ -338,7 +337,7 @@ export default defineEventHandler(async (event) => {
timestamp: expectoRequest.timestamp,
};

// return the valid license request
// return the valid request
return response;
});
```
Expand Down Expand Up @@ -394,12 +393,12 @@ export default defineEventHandler(async (event) => {
if (!expectoRequest) {
throw createError({
statusCode: 404,
message: 'License request not found',
message: 'Expecto request not found',
});
}

const installationId = await installation.findOne({
repositoryId: licenseRequest.repositoryId,
repositoryId: expectoRequest.repositoryId,
});

if (!installationId) {
Expand All @@ -409,7 +408,7 @@ export default defineEventHandler(async (event) => {
});
}

// Check if the user is authorized to access the license request
// Check if the user is authorized to access the request
await repoWritePermissions(event, expectoRequest.owner, expectoRequest.repo);

if (!expectoRequest.open) {
Expand Down Expand Up @@ -461,7 +460,7 @@ export default defineEventHandler(async (event) => {
},
);

// Create a new branch for the license addition
// Create a new branch for the addition
const newBranchName = `expecto-${nanoid()}`;

// Create a new branch from the default branch
Expand All @@ -475,7 +474,7 @@ export default defineEventHandler(async (event) => {
},
});

// Create a new file with the license content
// Create a new file with the content
await octokit.request('PUT /repos/{owner}/{repo}/contents/{path}', {
owner: expectoRequest.owner,
repo: expectoRequest.repo,
Expand Down Expand Up @@ -505,7 +504,7 @@ export default defineEventHandler(async (event) => {
);

// Save the PR URL to the database
// Update the license content and the license id in the database
// Update the content in the database
await collection.updateOne(
{
identifier,
Expand Down Expand Up @@ -572,11 +571,11 @@ export default defineEventHandler(async (event) => {
if (!expectoRequest) {
throw createError({
statusCode: 404,
message: 'License request not found',
message: 'Expecto request not found',
});
}

// Check if the user is authorized to access the license request
// Check if the user is authorized to access the request
await repoWritePermissions(event, expectoRequest.owner, expectoRequest.repo);

if (!expectoRequest.open) {
Expand Down

0 comments on commit 595c307

Please sign in to comment.