Skip to content

Commit

Permalink
add meta to goods/tools/glass
Browse files Browse the repository at this point in the history
  • Loading branch information
VovaStelmashchuk committed Sep 14, 2024
1 parent 72be610 commit 1d2bb15
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
7 changes: 5 additions & 2 deletions features/glassware/rest.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const express = require('express')
const { getGlasswareBySlug } = require('../../database/glassware');
const { buildImages } = require('../../utils/image');
const { buildImages, buildOgImage } = require('../../utils/image');
const router = express.Router();

router.get('/api/glassware/:slug', async (req, res) => {
Expand All @@ -17,7 +17,10 @@ router.get('/api/glassware/:slug', async (req, res) => {
slug: glassware.slug,
name: glassware.name,
about: glassware.about,
images: buildImages(glassware.id, 'ITEM')
images: buildImages(glassware.id, 'ITEM'),
meta: {
ogImage: buildOgImage(glassware.id, 'ITEM'),
},
});
}
});
Expand Down
5 changes: 4 additions & 1 deletion features/goods/rest.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

const express = require('express');
const { getGoodBySlug } = require('../../database/goods');
const { buildImages } = require('../../utils/image');
const { buildImages, buildOgImage } = require('../../utils/image');
const router = express.Router();

router.get('/api/goods/:slug', async (req, res) => {
Expand All @@ -17,6 +17,9 @@ router.get('/api/goods/:slug', async (req, res) => {
name: good.name,
about: good.about,
images: buildImages(good.id, 'ITEM'),
meta: {
ogImage: buildOgImage(good.id, 'ITEM'),
},
});
}
});
Expand Down
5 changes: 4 additions & 1 deletion features/tools/rest.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const express = require('express');
const { getToolBySlug } = require('../../database/tool');
const { buildImages } = require('../../utils/image');
const { buildImages, buildOgImage } = require('../../utils/image');
const router = express.Router();

router.get('/api/tools/:slug', async (req, res) => {
Expand All @@ -18,6 +18,9 @@ router.get('/api/tools/:slug', async (req, res) => {
name: tool.name,
about: tool.about,
images: buildImages(tool.id, 'ITEM'),
meta: {
ogImage: buildOgImage(tool.id, 'ITEM'),
},
});
}
});
Expand Down

0 comments on commit 1d2bb15

Please sign in to comment.