Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update frontend based on backend changes
  • Loading branch information
matiasbenedetto committed Aug 16, 2023
commit 051756ca9c0641401db3b3414b3c9ce389e45101
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,6 @@ function LocalFontVariant( { fontFile, onFontFaceLoad, onFontFaceRemove } ) {

const fontFaceData = {
file: fontFile,
// files as base64 uri
// src: font.toBase64(),
fontFamily: fontName,
fontStyle: isItalic ? 'italic' : 'normal',
fontWeight: !! weightAxis ? weightRange : fontWeight,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function LocalFonts() {
formData.append( `files${ i }`, item.file, item.file.name );
// Add the posted file id to the fontFace object
// This is needed to associate the fontFace with the file on the server
const face = { ...item, file: `files${ i }` };
const face = { ...item, uploadedFile: `files${ i }` };
acc[ item.fontFamily ].fontFace.push( face );
return acc;
}, {} );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import apiFetch from '@wordpress/api-fetch';

export async function fetchGoogleFonts() {
const config = {
path: '/wp/v2/fonts_library/google_fonts',
path: '/wp/v2/fonts/google_fonts',
};
const { fontFamilies, categories } = await apiFetch( config );
return {
Expand All @@ -34,7 +34,7 @@ export async function fetchInstallFonts( data ) {
}

const config = {
path: '/wp/v2/fonts_library',
path: '/wp/v2/fonts',
method: 'POST',
body,
};
Expand All @@ -45,7 +45,7 @@ export async function fetchInstallFonts( data ) {

export async function fetchUninstallFonts( data ) {
const config = {
path: '/wp/v2/fonts_library',
path: '/wp/v2/fonts',
method: 'DELETE',
data,
};
Expand Down