mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 09:09:36 +02:00
Add routes to save/get project notification preferences (#30114)
* Add routes to save/get project notification preferences * update route url * improve zod schema * remove unused json response * update schema and fix tests * add jsdoc types to pass type-check * remove using zod strict() GitOrigin-RevId: f3ab5c88b58bd5af71e0504d0efbe03bdf9b243c
This commit is contained in:
committed by
Copybot
parent
3b32b0a61e
commit
7b00e5d9f5
@@ -12,6 +12,8 @@ const { isZodErrorLike } = require('zod-validation-error')
|
||||
/**
|
||||
* A helper function to safely get a nested value from an object
|
||||
* using a path array (e.g., ["query", "resource_type"])
|
||||
* @param {any} data
|
||||
* @param {Array<PropertyKey>} path
|
||||
*/
|
||||
function getPathValue(data, path) {
|
||||
let current = data
|
||||
@@ -24,6 +26,10 @@ function getPathValue(data, path) {
|
||||
return current
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {any} issue
|
||||
* @param {any} value
|
||||
*/
|
||||
const isRequiredError = (issue, value) =>
|
||||
value === undefined &&
|
||||
(issue.code === 'invalid_type' || issue.code === 'invalid_union')
|
||||
|
||||
Reference in New Issue
Block a user