Added a not to the Images API ref field

refs https://github.com/TryGhost/Ghost/pull/10534

- The original PR has no explanation around the purpose of the ref field and it's easy to forget without knowing a wider context. Documented it to remember next time we come around working on this part of the codebase!
This commit is contained in:
Naz 2021-10-28 16:05:54 +04:00
parent ca2c9b92cd
commit d89b8448ab
3 changed files with 12 additions and 0 deletions

View File

@ -8,6 +8,10 @@ module.exports = {
return frame.response = {
images: [{
url: mapper.mapImage(path),
// NOTE: ref field is here to have reference point on the client
// for example when substituting existing images in the mobiledoc
// this field would serve as an identifier to find images to replace
// once the response is back. Think of it as ID on the client's side.
ref: frame.data.ref || null
}]
};

View File

@ -8,6 +8,10 @@ module.exports = {
return frame.response = {
images: [{
url: mapper.mapImage(path),
// NOTE: ref field is here to have reference point on the client
// for example when substituting existing images in the mobiledoc
// this field would serve as an identifier to find images to replace
// once the response is back. Think of it as ID on the client's side.
ref: frame.data.ref || null
}]
};

View File

@ -8,6 +8,10 @@ module.exports = {
return frame.response = {
images: [{
url: mapper.mapImage(path),
// NOTE: ref field is here to have reference point on the client
// for example when substituting existing images in the mobiledoc
// this field would serve as an identifier to find images to replace
// once the response is back. Think of it as ID on the client's side.
ref: frame.data.ref || null
}]
};