Skip to content

Commit

Permalink
chore: run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Aug 12, 2024
1 parent 440b7c1 commit d73ac8d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 29 deletions.
37 changes: 12 additions & 25 deletions src/server/api/project/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export async function updateCircleEnvVars(project: Project, accessToken: string)
);
if (existing.status !== 200) return;

if (existing.data.find(item => item.name === 'CFA_SECRET')) {
if (existing.data.find((item) => item.name === 'CFA_SECRET')) {
await client.delete(
`/project/github/${project.repoOwner}/${project.repoName}/envvar/CFA_SECRET`,
);
Expand All @@ -45,7 +45,7 @@ export async function updateCircleEnvVars(project: Project, accessToken: string)
value: project.secret,
});

if (existing.data.find(item => item.name === 'CFA_PROJECT_ID')) {
if (existing.data.find((item) => item.name === 'CFA_PROJECT_ID')) {
await client.delete(
`/project/github/${project.repoOwner}/${project.repoName}/envvar/CFA_PROJECT_ID`,
);
Expand Down Expand Up @@ -86,7 +86,7 @@ export async function updateGitHubActionsEnvironment(
repo: project.repoName,
});
const cfaReleaseEnv = allEnvs.data.environments?.find(
e => e.name === CFA_RELEASE_GITHUB_ENVIRONMENT_NAME,
(e) => e.name === CFA_RELEASE_GITHUB_ENVIRONMENT_NAME,
);
if (!cfaReleaseEnv) {
await github.repos.createOrUpdateEnvironment({
Expand Down Expand Up @@ -173,14 +173,10 @@ export function configRoutes() {
{
a,
params: {
id: Joi.number()
.integer()
.required(),
id: Joi.number().integer().required(),
},
body: {
accessToken: Joi.string()
.min(1)
.required(),
accessToken: Joi.string().min(1).required(),
},
},
async (req, res) => {
Expand All @@ -207,7 +203,7 @@ export function configRoutes() {

await updateCircleEnvVars(project, req.body.accessToken);

const newProject = await withTransaction(async t => {
const newProject = await withTransaction(async (t) => {
const config = await CircleCIRequesterConfig.create(
{
accessToken: req.body.accessToken,
Expand Down Expand Up @@ -236,9 +232,7 @@ export function configRoutes() {
{
a,
params: {
id: Joi.number()
.integer()
.required(),
id: Joi.number().integer().required(),
},
body: {},
},
Expand All @@ -253,7 +247,7 @@ export function configRoutes() {
return res.status(500).json({ error: 'Unknown Error' });
}

const newProject = await withTransaction(async t => {
const newProject = await withTransaction(async (t) => {
const config = await GitHubActionsRequesterConfig.create(
{},
{
Expand All @@ -280,16 +274,14 @@ export function configRoutes() {
{
a,
params: {
id: Joi.number()
.integer()
.required(),
id: Joi.number().integer().required(),
},
},
async (req, res) => {
const project = await getProjectFromIdAndCheckPermissions(req.params.id, req, res);
if (!project) return;

const linker = await withTransaction(async t => {
const linker = await withTransaction(async (t) => {
await SlackResponderLinker.destroy({
where: {
projectId: project.id,
Expand Down Expand Up @@ -321,15 +313,10 @@ export function configRoutes() {
{
a,
params: {
id: Joi.number()
.integer()
.required(),
id: Joi.number().integer().required(),
},
body: {
usernameToMention: Joi.string()
.min(1)
.max(50)
.required(),
usernameToMention: Joi.string().min(1).max(50).required(),
},
},
async (req, res) => {
Expand Down
7 changes: 3 additions & 4 deletions src/server/requesters/GitHubActionsRequester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ type GitHubActionsOTPRequestMetadata = {

const validateMetadataObject = (object: any) => {
return Joi.validate(object, {
oidcToken: Joi.string()
.min(1)
.required(),
oidcToken: Joi.string().min(1).required(),
buildUrl: Joi.string()
.uri({
scheme: 'https:',
Expand All @@ -30,7 +28,8 @@ const validateMetadataObject = (object: any) => {
};

export class GitHubActionsRequester
implements Requester<GitHubActionsRequesterConfig, GitHubActionsOTPRequestMetadata> {
implements Requester<GitHubActionsRequesterConfig, GitHubActionsOTPRequestMetadata>
{
readonly slug = 'github';

getConfigForProject(project: Project) {
Expand Down

0 comments on commit d73ac8d

Please sign in to comment.