Untitled
unknown
plain_text
2 years ago
585 B
10
Indexable
type Error = variant { NotFound : record { msg : text } };
type Message = record {
id : nat64;
title : text;
updated_at : opt nat64;
body : text;
created_at : nat64;
attachment_url : text;
};
type MessagePayload = record {
title : text;
body : text;
attachment_url : text;
};
type Result = variant { Ok : Message; Err : Error };
service : {
add_message : (MessagePayload) -> (opt Message);
delete_message : (nat64) -> (Result);
get_message : (nat64) -> (Result) query;
greet : (text) -> (text) query;
update_message : (nat64, MessagePayload) -> (Result);
}
Editor is loading...
Leave a Comment