houdini/javascripts/src/lib/dedication.ts

23 lines
431 B
TypeScript
Raw Normal View History

2018-10-01 20:31:18 +00:00
// License: LGPL-3.0-or-later
export interface Dedication {
type?:'honor'|'memory',
supporter_id?: number,
name?:string
contact?: string,
note?:string
}
export function parseDedication(dedication?:string) : Dedication {
if (!dedication || dedication == "")
return {}
return JSON.parse(dedication)
}
export function serializeDedication(dedication:Dedication) : string {
return JSON.stringify(dedication)
}