-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
79b7952
commit 8a3afcb
Showing
1 changed file
with
42 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const DIRECTUS_URL = process.env.DIRECTUS_URL; | ||
const ADMIN_ACCESS_TOKEN = process.env.ADMIN_ACCESS_TOKEN; | ||
|
||
async function updateCssRules () { | ||
const URL = `${DIRECTUS_URL}/settings?access_token=${ADMIN_ACCESS_TOKEN}`; | ||
const response = await fetch(URL, { | ||
method: 'PATCH', | ||
body: JSON.stringify({ | ||
custom_css: | ||
`body:has(.router-link-active[href="/admin/content/gp_tokens"]) .search-input { | ||
display: none !important; | ||
} | ||
.module-bar-logo { | ||
background-color: inherit !important; | ||
} | ||
.module-bar-logo .custom-logo { | ||
scale: .7; | ||
}`, | ||
}), | ||
headers: { | ||
'Content-Type': 'application/json', | ||
}, | ||
}).then((response) => { | ||
if (!response.ok) { | ||
throw new Error(`Fetch request failed. Status: ${response.status}`); | ||
} | ||
|
||
return response.json(); | ||
}); | ||
return response.data; | ||
} | ||
|
||
export async function up () { | ||
await updateCssRules(); | ||
console.log('Successfully updated custom css.'); | ||
} | ||
|
||
export async function down () { | ||
console.log('There is no down operation for that migration.'); | ||
} |