// The fucntion now accepts a gif_link param from the user.
The fucntion now accepts a gif_link param from the user.
The fucntion now accepts a gif_link param from the user .
pub fn add_gif(ctx: Context<AddGif>, gif_link: String) -> ProgramResult {
        let base_account = &mut ctx.accounts.base_account;
        // Build the struct.
        let item = ItemStruct {
            gif_link: gif_link.to_string(),
            user_address: *base_account.to_account_info().key,
        };
        // Add it to the gif_list vector.
        base_account.gif_list.push(item);
        base_account.total_gifs += 1;
        Ok(())
    }
pub fn add_gif ( ctx : Context < AddGif > , gif_link : String ) -> ProgramResult { let base_account = & mut ctx . accounts . base_account ; // Build the struct. let item = ItemStruct { gif_link : gif_link . to_string ( ) , user_address : * base_account . to_account_info ( ) . key , } ; // Add it to the gif_list vector. base_account . gif_list . push ( item ) ; base_account . total_gifs += 1 ; Ok ( ( ) ) }
The fucntion now accepts a gif_link param from the user.
The fucntion now accepts a gif_link param from the user .
ctx
Context<AddGif>
gif_link
String